コード例 #1
0
 protected override void Update()
 {
     if (CurrentShotDelay > 0)
     {
         CurrentShotDelay -= Time.deltaTime;
         if (CurrentShotDelay <= 0)
         {
             JointObject(null);
             Cannon.SetState(true);
             SoundB.SetActive(false);
             SoundB.SetActive(true);
         }
     }
     else if (ShotCooldown <= 0)
     {
         base.Update();
     }
     else
     {
         ShotCooldown -= Time.deltaTime;
         if (ShotCooldown <= 0)
         {
             if (CurrentState)
             {
                 Observer.ChangeState(true);
             }
         }
     }
 }
コード例 #2
0
 protected override bool StateChangeEvent(bool _Activity)
 {
     if (Observer)
     {
         return(Observer.ChangeState(_Activity));
     }
     return(_Activity);
 }
コード例 #3
0
 protected override Rigidbody2D JointObject(Rigidbody2D _RigidbodyObject)
 {
     if (_RigidbodyObject)
     {
         ShotCooldown     = 1;
         CurrentShotDelay = ShotDelay;
         Cannon.HeadBulletCharge(_RigidbodyObject);
         Observer.ChangeState(false);
         Debug.Log("장전");
     }
     return(base.JointObject(_RigidbodyObject));
 }