void Awake()
    {
        Blending = GetComponent <AnimationBlending>();

        AudioSources    = new AudioSource[2];
        AudioSources[0] = InstantiateAudioSource("Footstep Audio Source 1");
        AudioSources[1] = InstantiateAudioSource("Footstep Audio Source 2");
    }
Exemple #2
0
    void Awake()
    {
        PlayerGameManager       = GameManager.Instance;
        PlayerAnimationBlending = PlayerGameManager.GetComponent <AnimationBlending>();

        PlayerGameManager.OnMoneyValueChanged += SetMoneyText;
        PlayerGameManager.OnHealthChange      += PlayerGameManager_OnCauseDamage;

        TimeText.enabled = LevelManager.Instance.DoesItHaveTime;
    }
 public void SetBlendingRatio()
 {
     if (!init)
     {
         init      = true;
         cubeman   = GlobalData.GetFocusObj();
         animBlend = cubeman.GetComponent <AnimationBlending>();
     }
     GlobalData.blendingRatio = slider.value;
     animBlend.SetBlending(GlobalData.blendingRatio);
 }
Exemple #4
0
    void Start()
    {
        rigid = GetComponent <Rigidbody>();
        speed = autorun.speedRun;
        if (Instance == null)
        {
            Instance = this;
        }
//		PlayerPrefs.SetInt ("movementassist",0);
        if (!PlayerPrefs.HasKey(UMPKeys.Controller) || PlayerPrefs.GetInt(UMPKeys.Controller) == 0)
        {
            GameObject.Find("Ultimate UI Canvas").SetActive(false);
            _blends.SetBool("assist", true);
            isRunning = true;
            _assist   = true;
            _blends.applyRootMotion = false;
            GameObject[] col = GameObject.FindGameObjectsWithTag("Trap");
            foreach (var _col in col)
            {
                var t = _col.GetComponent <BoxCollider> ();
                if (t != null)
                {
                    t.isTrigger = true;
                }
            }
            GameObject[] col2 = GameObject.FindGameObjectsWithTag("Enemy");
            foreach (var _col in col2)
            {
                var t = _col.GetComponent <BoxCollider> ();
                if (t != null)
                {
                    t.isTrigger = true;
                }
            }
        }
        else if (PlayerPrefs.GetInt("movementassist") == 1)
        {
            GameObject.Find("Ultimate UI Canvas").SetActive(true);
            _blends.SetBool("assist", false);
            isRunning = false;
            _assist   = false;
            _blends.applyRootMotion = true;
        }
    }