小编Min*_*wzy的帖子

Unity - 在场景之间传递数据

如何将得分值从一个场景传递到另一个场景?

我尝试过以下方法:

场景一:

void Start () {
    score = 0;
    updateScoreView ();
    StartCoroutine (DelayLoadlevel(20));
}

public void updateScoreView(){
    score_text.text = "The Score: "+ score;
}

public void AddNewScore(int NewscoreValue){
    score = score + NewscoreValue;
    updateScoreView ();
}

IEnumerator DelayLoadlevel(float seconds){        
    yield return new WaitForSeconds(10);
    secondsLeft = seconds;
    loadingStart = true;
    do {        
        yield return new WaitForSeconds(1);
    } while(--secondsLeft >0);

    // here I should store my last score before move to level two
    PlayerPrefs.SetInt ("player_score", score);
    Application.LoadLevel (2);
}
Run Code Online (Sandbox Code Playgroud)

场景二:

public …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine virtual-reality

17
推荐指数
4
解决办法
3万
查看次数

Firebase中未注册的注册令牌

我得到了未注册的注册令牌,即使我确定我的令牌是正确的,我在我的日志中检查它我正在使用主令牌FirebaseInstanceId.Instance.Token.

这是我的方法:

private void ConfigureFireBase()
        {

            Task.Run(() => {
                var instanceId = FirebaseInstanceId.Instance;
                Android.Util.Log.Debug("TAG", "{0} {1}", instanceId?.Token?.ToString(), instanceId.GetToken(GetString(Resource.String.gcm_defaultSenderId), Firebase.Messaging.FirebaseMessaging.InstanceIdScope));

            });

        }
Run Code Online (Sandbox Code Playgroud)

我也检查同样的OnTokenRefresh方法

public override void OnTokenRefresh()
        {
            var refreshedToken = FirebaseInstanceId.Instance.Token;
            Log.Debug(TAG, "Refreshed token: " + refreshedToken);
            SendRegistrationToServer(refreshedToken);
        }
Run Code Online (Sandbox Code Playgroud)

但是当我在Firebase控制台中尝试时,它给了我这个错误消息,当我在http://pushtry.com/中尝试使用相同的令牌时,我没有收到NotRegistered消息

请注意,当我卸载应用程序并再次安装令牌工作时,但在我收到此错误消息后.

android xamarin.android firebase-cloud-messaging

16
推荐指数
1
解决办法
1万
查看次数

Xamarin.android默认FirebaseApp未在此过程中初始化

我遇到来自firebase的get令牌问题(推送通知)

Default FirebaseApp is not initialized in this process com.ready_apps.Nebka.Business. Make sure to call FirebaseApp.initializeApp(Context) first.
Run Code Online (Sandbox Code Playgroud)

甚至我打电话给FirebaseApp.InitializeApp(this); 在很多地方

MyApplication(扩展Application),在我调用的onCreate of Activity中 FirebaseInstanceId.Instance?.Token;

android push-notification xamarin.android firebase firebase-cloud-messaging

11
推荐指数
2
解决办法
4401
查看次数

如何向 Material UI 选择选项添加图标?

如何在选择选项中添加图标我做了很多次尝试都没有工作

 <option value={0}>&#xf083;Item One</option>
        <option value={1}>
          <i class="fas fa-expand" />
          Item two
        </option>
Run Code Online (Sandbox Code Playgroud)

完整的示例代码

class IconInSelect extends Component {
  state = {
    value: 0
  };
  handleChange = name => event => {
    this.setState({ [name]: event.target.value });
  };
  render() {
    const { value } = this.state;
    const { classes } = this.props;
    return (
      <Select
        autoWidth
        native
        value={value}
        onChange={this.handleChange("value")}
        name="value"
        variant="filled"
        classes={{
          root: classes.selectEmpty,
          select: classes.select
        }}
      >
        <option value={0}>&#xf083;Item One</option>
        <option value={1}>
          <i class="fas fa-expand" />
          Item two
        </option>
        <option …
Run Code Online (Sandbox Code Playgroud)

reactjs material-ui

9
推荐指数
2
解决办法
1万
查看次数

线程优先级安全性异常确保apk已签名

我正在尝试使用unity5 在oculus gear vr中构建我的项目,但是当我部署我的应用程序时,我得到以下错误

thread priority security exception make sure the apk is signed
Run Code Online (Sandbox Code Playgroud)

我甚至创建了密钥库

在此输入图像描述

任何建议为什么我可能会在齿轮vr中遇到这个错误

android unity-game-engine oculus unity5 gear-vr

8
推荐指数
1
解决办法
2万
查看次数

货币输入为2十进制格式

我需要格式化输入货币用2十进制格式示例当用户输入2时它看起来是$ 2.00然后当用户输入2时它转换为$ 22.00 ...等

我接近类似的东西,当用户输入2时它转换为$ 0.02接下来2将是这样的$ 0.22

任何人都可以帮助我,谢谢你

public class MoneyTextWatcher implements TextWatcher {
    private final WeakReference<EditText> editTextWeakReference;

    public MoneyTextWatcher(EditText mEditText) {
        editTextWeakReference = new WeakReference<EditText>(mEditText);
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

       EditText editTex = editTextWeakReference.get();
        if(!s.toString().equals(editTex.getText())) {
            editTex.removeTextChangedListener(this);
            String cleanString = s.toString().replaceAll("[$,.]", "");
            double parsed = Double.parseDouble(cleanString.replaceAll("[^\\d]", ""));
            String formatted = NumberFormat.getCurrencyInstance().format((parsed / 100));
            editTex.setText(formatted);
            editTex.setSelection(formatted.length());

            editTex.addTextChangedListener(this);

    }

    @Override …
Run Code Online (Sandbox Code Playgroud)

android currency android-edittext

8
推荐指数
1
解决办法
2万
查看次数

Xamarin.iOS ApplicationVerificationFailed:无法验证代码签名

为什么当我尝试在真实设备而不是模拟器中运行应用程序时出现此错误

\n\n
ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.ttjwEf/extracted/DSP.IOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)\nerror MT1006: Could not install the application \'/Users/macbookpro/Documents/gitProject/DSPMobileGit/DSP.Mobile/DSP.iOS/DSP.IOS/bin/iPhone/Debug/device-builds/iphone6.2-9.3.5/DSP.IOS.app\' on the device \'Mohamed\xe2\x80\x99s iPhone\': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是我运行我的应用程序的步骤

\n\n

首先,我在 Xcode 中使用相同的包名称创建项目,并让 Xcode …

xamarin.ios ios-provisioning

8
推荐指数
2
解决办法
2万
查看次数

WildFly 21 - 找不到默认服务器的路由提供商;使用基于静态配置的遗留提供程序

我在运行 wildFly 服务器时收到此警告

16:54:56,327 WARN  [org.wildfly.clustering.web.undertow] (ServerService Thread Pool -- 77) WFLYCLWEBUT0007: No routing provider found for default-server; using legacy provider based on static configuration
Run Code Online (Sandbox Code Playgroud)

wildfly wildfly-21

7
推荐指数
1
解决办法
1485
查看次数

失败保存状态:活动SupportMapFragment {}已清除索引:-1

我正在使用supportMapFragment里面的片段这就是为什么我使用this.getChildFragmentManager()如果这个错误请指导我

public static ClinicFragment newInstance() {
        ClinicFragment fragment = new ClinicFragment();
        return fragment;
    }
    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        setTargetFragment(null , -1); // one of my tries 
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_maps, null, false);

        Log.i(TAG , "onCreateView");

        mapFragment = (SupportMapFragment) this.getChildFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        mapUtils = new MapUtils(getActivity());
        .......
        return view;
    }


 @Override
    public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap) {
        mMap = googleMap;
        mMap.setMyLocationEnabled(true);
        mMap.getUiSettings().setZoomControlsEnabled(true);
        mMap.setOnMarkerClickListener(this);
    }

@Override …
Run Code Online (Sandbox Code Playgroud)

java android android-fragments supportmapfragment

6
推荐指数
1
解决办法
3416
查看次数

iOS - 如何在Objective C中向kal库添加事件?

我在项目需要日历视图中处理事件,我尝试了很多库,但最后我决定使用kal库,因为它有能力添加事件

Calendar.h

#import "Kal.h"
#import "NSDate+Convenience.h"
#import "EventKitDataSource.h"


@interface Calendar : UIViewController<WebService_Delegate , UITableViewDelegate >
{


    KalViewController *kal;
    id dataSource;
}
Run Code Online (Sandbox Code Playgroud)

Calendar.m

- (void)viewDidLoad
{
    [super viewDidLoad];



    self.title = @"Caledar";
    kal = [[KalViewController alloc]initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[NSDate date]];
     kal.delegate = self;


    kal.view.frame = CGRectMake(0, 65, kal.view.frame.size.width, kal.view.frame.size.height);

    [kal showAndSelectDate:[NSDate date]];
    //navController = [[UINavigationController alloc]initWithRootViewController:kal];
   // [self.view addSubview:navController.view];
    [self initVariable];
    [self getEvents];


    dataSource = [[EventKitDataSource alloc] init];
    kal.dataSource = dataSource;



   [self.view addSubview:kal.view];

}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath …
Run Code Online (Sandbox Code Playgroud)

xcode calendar objective-c ios kal

5
推荐指数
1
解决办法
582
查看次数