Exemplo n.º 1
0
        private void OnEnable()
        {
            _character = GetComponent <C_Character>();
            _agent     = GetComponent <NavMeshAgent>();

            Assert.IsNotNull(_character);
            Assert.IsNotNull(_agent);
        }
Exemplo n.º 2
0
        private void OnEnable()
        {
            _character = GetComponent <C_Character>();
            _character.Control.OnWestButtonDown += Repair;
            _character.Control.OnWestButtonUp   += Release;

            Assert.IsNotNull(_character);
        }
Exemplo n.º 3
0
 void OnTriggerEnter(Collider other)
 {
     // collision with player
     if (other.gameObject.tag == "Player")
     {
         C_Character character = other.transform.root.GetComponent <C_Character>();
         if (character.Team != Team)
         {
             character.Health--;
             ResetPainball();
         }
     }
 }
Exemplo n.º 4
0
        private void OnEnable()
        {
            _character = GetComponent <C_Character>();

            _triggerHand      = GetComponentInChildren <C_TriggerHand>();
            _triggerBot       = GetComponentInChildren <C_TriggerBot>();
            _triggerWorkbench = GetComponentInChildren <C_TriggerWorkbench>();

            Assert.IsNotNull(_character);
            Assert.IsNotNull(_triggerHand);
            Assert.IsNotNull(_triggerBot);
            Assert.IsNotNull(_triggerWorkbench);

            _character.Control.OnSouthButtonUp += ButtonSouthReleased;
            _character.Control.OnWestButtonUp  += ButtonWestReleased;

            EnableHand();
        }
Exemplo n.º 5
0
 private void MakeGunshotSound(Vector3 position, GameObject user)
 {
     if (this.ShotSound != null)
     {
         if (base.transform.root.GetComponent <C_NPCManager>() == null)
         {
             if (user.transform.Find("FPSCamera") == null)
             {
                 return;
             }
             AudioSource component = user.transform.Find("FPSCamera").GetComponent <AudioSource>();
             if (component == null)
             {
                 return;
             }
             component.clip = this.ShotSound;
             component.Play();
             if (this.m_pC_AxeSwing == null)
             {
                 C_GameStatsManager.m_Instance.m_GameStatsData.m_ShotsFired++;
             }
             if (this.m_ConsumesAmmo)
             {
                 C_PlayerStealthMonitor.m_Instance.AddSpike();
             }
         }
         else
         {
             base.audio.clip = this.ShotSound;
             base.audio.Play();
         }
         int type = 0;
         if (user != null)
         {
             C_Character component2 = user.GetComponent <C_Character>();
             if (component2 != null)
             {
                 type = component2.m_Faction;
             }
         }
         C_AudioBroadcaster.MakeSound(user, position, this.GunshotVolume, type);
     }
 }
Exemplo n.º 6
0
        private void OnEnable()
        {
            _character = GetComponent <C_Character>();

            Assert.IsNotNull(_character);
        }