public void SwitchToAlert() { velocity.x = 0; spiderWalkerState = SpiderWalkerState.alert; endAlertTime = Time.time + alertAttentionSpan; timeToFire = Time.time + alertTimeUntilFire; }
void Start() { footstepSound = GetComponent <AudioSource>(); controller = GetComponent <Controller2D>(); thisCollider = GetComponent <Collider2D>(); animator = GetComponent <Animator>(); audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManager>(); cam = Camera.main; gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>(); footbone = TransformDeepChildExtension.FindDeepChild(gameObject.transform, "Front Foot"); bow = TransformDeepChildExtension.FindDeepChild(gameObject.transform, "Bow"); bow.localScale = new Vector3(1 / gameObject.transform.lossyScale.x, 1 / gameObject.transform.lossyScale.y, 1 / gameObject.transform.lossyScale.z); globalMaxInvestigateRange = localMaxInvestigateRange + transform.position; globalMinInvestigateRange = localMinInvestigateRange + transform.position; globalMaxPatrolRange = localMaxPatrolRange + transform.position; globalMinPatrolRange = localMinPatrolRange + transform.position; spiderWalkerState = SpiderWalkerState.patrolling; destPoint = globalMaxPatrolRange; patrolMovementState = PatrolMovementState.max; faceDirX = 1; }
public void ReleaseShockwave() { if (Time.time > endShockwaveCooldownTime) { //SwitchToShocking (); if (spiderWalkerState == SpiderWalkerState.patrolling) { spiderWalkerState = SpiderWalkerState.SwitchingToAlert; } Instantiate(shockwave, gameObject.transform.position, gameObject.transform.rotation); endShockwaveCooldownTime = Time.time + shockwaveCooldown; } }
public void SwitchToDeath_AnimCall() { spiderWalkerState = SpiderWalkerState.dead; }
void SwitchToDying() { spiderWalkerState = SpiderWalkerState.dying; PlayPowerDown(); }
void SwitchToFlying() { spiderWalkerState = SpiderWalkerState.flying; }
void SwitchToShocking() { velocity.x = 0; spiderWalkerState = SpiderWalkerState.shocking; }
void SwitchToFiring() { spiderWalkerState = SpiderWalkerState.firing; firingState = FiringState.prepping; endFireTime = Time.time + fireAttentionSpan; }
void SwitchToSwitchingToAlert() { velocity.x = 0; spiderWalkerState = SpiderWalkerState.SwitchingToAlert; }
void SwitchToPatrol() { spiderWalkerState = SpiderWalkerState.patrolling; }