void Start() { gm = gameMaster.master; rb2d = gameObject.GetComponent <Rigidbody2D>(); anim = gameObject.GetComponentInChildren <Animator>(); groundCheckObj = gameObject.GetComponentInChildren <objGroundCheck>(); wallCheck = gameObject.GetComponentInChildren <collisionDetector>(); platformCheck = gameObject.GetComponentInChildren <checkPlatformExit>(); biteZone = gameObject.GetComponentInChildren <playerAttackZone>(); hitBox = gameObject.GetComponentInChildren <playerRepel>(); target = GameObject.FindGameObjectWithTag("Frog").transform; if (alwaysAwake) { awake = true; state = (int)CrocState.STATE_WALKING; } else { state = (int)CrocState.STATE_SLEEPING; } pauseTime = Random.Range(3, 10); }
void Start() { rb2d = GetComponentInParent <Rigidbody2D>(); groundObj = transform.parent.GetComponentInChildren <objGroundCheck>(); gravityStore = rb2d.gravityScale; }