void Awake()
 {
     instance      = this;
     chrController = GetComponent <CharacterController>();
     anim          = GetComponentInChildren <Animator>();
     anim.SetInteger("State", (int)AnimType.Walk);
     NowAction                = ActionType.Walk;
     MapCollisionLayerMask    = LayerMask.GetMask("MapCollision");
     boxColliderHalfExtents.y = chrController.height * 0.5f - walkDownY;
     defaultLayer             = LayerMask.NameToLayer("Player");
     jumpLayer                = LayerMask.NameToLayer("Jump");
     forwardVector            = Vector3.right;
     splashParticle           = transform.Find("Splash").GetComponent <ParticleSystem>();
     splashParticle.transform.SetParent(null);
     Pivot             = transform.Find("Pivot");
     ActionBoxInstance = GetComponentInChildren <ActionBox>();
     naeActable        = null;
     ActionBoxInstance.Init();
 }
Example #2
0
 void Awake()
 {
     instance       = this;
     ChrController  = GetComponent <CharacterController>();
     waterAudio     = GetComponent <AudioSource>();
     stellaAnimator = transform.Find("Pivot").GetComponentInChildren <Animator>();
     stellaAnimator.SetInteger("State", (int)AnimType.Walk);
     NowAction = ActionType.Walk;
     boxColliderHalfExtents.y = ChrController.height * 0.5f - walkDownY;
     defaultLayer             = LayerMask.NameToLayer("Player");
     jumpLayer      = LayerMask.NameToLayer("Jump");
     forwardVector  = Vector3.right;
     splashParticle = transform.Find("Splash").GetComponent <ParticleSystem>();
     splashParticle.transform.SetParent(null);
     Pivot             = transform.Find("Pivot");
     ActionBoxInstance = GetComponentInChildren <ActionBox>();
     naeActable        = null;
     ActionBoxInstance.Init();
     SoundController.audioListener.enabled  = false;
     GetComponent <AudioListener>().enabled = true;
 }