コード例 #1
0
    public override void OnShow(object param = null)
    {
        // UIManager.I.ShowView<ResultView> (true);
        var allAudio = GetComponents <AudioSource> ();

        _audioHit = allAudio[0];
        _audioHit.Stop();
        _audioWin = allAudio[1];
        _audioWin.Stop();
        _initGameInfo = param as GameInfoData;
        _curCaTrans   = SceneLoadManager.I.GetSceneNodeTrans(SaveData.curCheckPoint, "Camera");
        _curBridge    = SceneLoadManager.I.GetSceneNodeTrans(SaveData.curCheckPoint, "Bridge");
        _curWater1    = SceneLoadManager.I.GetSceneNodeTrans(SaveData.curCheckPoint, "Water1");
        _curWater2    = SceneLoadManager.I.GetSceneNodeTrans(SaveData.curCheckPoint, "Water2");
        _initWaterPos = _curWater1.localPosition;
        this.StartCoroutine(_TranslateWater());
        _caInitPos  = _curCaTrans.localPosition;
        _rigidbody  = transform.GetComponent <Rigidbody> ();
        _myAnimator = transform.GetComponent <Animator> ();
        _initPos    = new Vector3(_initGameInfo.X, _initGameInfo.Y, _initGameInfo.Z);
        obFlag      = 1;
        _InitInfo();
        EventUtils.AddListener("EnemyIsDie", _EnemyIsDie);
        EventUtils.AddListener("Start", _CanStart);
        EventUtils.AddListener("MainRoleBeForce", _MainRoleBeForce);
        EventUtils.AddListener("InitMainPos", _InitMainPos);
#if UNITY_ANDROID
        if (_shakeActivity == null)
        {
            AndroidJavaClass jc = new AndroidJavaClass("com.Uqee.LittleGame.ClickShake");
            _shakeActivity = jc.GetStatic <AndroidJavaObject> ("_mClickShake");
        }
#endif
    }
コード例 #2
0
 public override void OnShow(object param = null)
 {
     if (param != null)
     {
         var info = (GameInfoData)param;
         transform.localPosition = new Vector3(info.X, info.Y, info.Z);
         rounds = info.Rounds;
     }
     EventUtils.AddListener("IsWin", _IsWin);
 }
コード例 #3
0
    public override void OnShow(object param = null)
    {
        txt_opentime.text = param.ToString();
        //UIManager.I.ShowView<TestView1>("111222");

        btn_start.onClick.AddListener(_OnclickBtnStart);
        btn_restart.onClick.AddListener(_OnclickBtnRestart);
        btn_next.onClick.AddListener(_OnclickBtnNext);

        EventUtils.AddListener("OnClickNextCheckPoint", _OnClickNextCheckPoint);
    }
コード例 #4
0
    public override void Init()
    {
        var allAudio = GetComponents <AudioSource>();

        txt_gold.text = SaveData.gold_num.ToString();
        _audioBg      = allAudio[0];
        _audioButton  = allAudio[1];
        _audioButton.Stop();
        btn_start.onClick.AddListener(_OnclickBtnStart);
        shakeInitPos = img_combo.transform.localPosition;
        gameObject.SetActive(false);
        EventUtils.AddListener("OnClickNextCheckPoint", _GoToNextScene);
        EventUtils.AddListener("BuffCDIcon", _BuffCDIcon);
        EventUtils.AddListener("PlayClickBtnMusic", _PlayClickBtnMusic);
        EventUtils.AddListener("EatCoin", _EatCoin);
        EventUtils.AddListener("ShowCombo", _ShowCombo);
        //EventUtils.AddListener("ShakeScreen", _ShakeScreen);
        EventUtils.AddListener("ShowView", _ShowView);
    }
コード例 #5
0
 public override void OnShow(object param = null)
 {
     _speed = 1;
     _curVolumeCoefficient = 1;
     _initPos  = new Vector3(0, 0, 6);
     _curRidus = 15;
     if (param != null)
     {
         var info = (GameInfoData)param;
         _curVolumeCoefficient = info.VolumeCoefficient;
         var y = info.Y;
         _initPos  = new Vector3(info.X, info.Y, info.Z);
         _speed    = info.Speed - 1;
         _curRidus = info.Radius;
         rounds    = info.Rounds;
     }
     _rigidbody  = transform.GetComponent <Rigidbody> ();
     _myAnimator = transform.GetComponent <Animator> ();
     _InitInfo();
     EventUtils.AddListener("Start", _CanStart);
 }