Esempio n. 1
0
 public void SwitchToAlert()
 {
     velocity.x        = 0;
     spiderWalkerState = SpiderWalkerState.alert;
     endAlertTime      = Time.time + alertAttentionSpan;
     timeToFire        = Time.time + alertTimeUntilFire;
 }
Esempio n. 2
0
    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;
    }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
 public void SwitchToDeath_AnimCall()
 {
     spiderWalkerState = SpiderWalkerState.dead;
 }
Esempio n. 5
0
 void SwitchToDying()
 {
     spiderWalkerState = SpiderWalkerState.dying;
     PlayPowerDown();
 }
Esempio n. 6
0
 void SwitchToFlying()
 {
     spiderWalkerState = SpiderWalkerState.flying;
 }
Esempio n. 7
0
 void SwitchToShocking()
 {
     velocity.x        = 0;
     spiderWalkerState = SpiderWalkerState.shocking;
 }
Esempio n. 8
0
 void SwitchToFiring()
 {
     spiderWalkerState = SpiderWalkerState.firing;
     firingState       = FiringState.prepping;
     endFireTime       = Time.time + fireAttentionSpan;
 }
Esempio n. 9
0
 void SwitchToSwitchingToAlert()
 {
     velocity.x        = 0;
     spiderWalkerState = SpiderWalkerState.SwitchingToAlert;
 }
Esempio n. 10
0
 void SwitchToPatrol()
 {
     spiderWalkerState = SpiderWalkerState.patrolling;
 }