Exemplo n.º 1
0
 void Awake()
 {
     wolfHealth      = GetComponent <WolfHealth> ();
     animController  = GetComponent <Animator> ();
     audioSource     = GetComponent <AudioSource> ();
     variableStorage = GameObject.FindGameObjectWithTag("VariableStorage").GetComponent <VariableStorageController> ();
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     health_script       = GetComponent <WolfHealth>();
     healt_max           = health_script.GetHealthMax();
     healtBar.fillAmount = 1;
     canevas.SetActive(false);
     if (camera == null)
     {
         camera = GameObject.FindGameObjectWithTag("MainCamera");
     }
 }
Exemplo n.º 3
0
        public override IEnumerator Activate(GameObject go)
        {
            if (!IsInPreviewMode && go.tag.Contains("Wolf"))
            {
                GameObject boom = CFX_SpawnSystem.GetNextObject(ExplosionEffect);
                boom.transform.position = gameObject.transform.position;

                foreach (var superTarget in Physics
                         .OverlapSphere(transform.position, GameVariables.Trap.LandMine.radius[Level - 1])
                         .Where(T => T.gameObject.tag.Contains("Wolf")))
                {
                    WolfHealth wolf = (WolfHealth)superTarget.GetComponent <WolfHealth>();
                    wolf.takeDamage(Pows[Level - 1]);
                }
                Durability--;
                if (Durability == 0)
                {
                    Destroy(gameObject);
                }
            }
            yield break;
        }
Exemplo n.º 4
0
        public override IEnumerator Activate(GameObject go)
        {
            if (go.tag.Contains("Wolf"))
            {
                TrapPrefab.GetComponent <Animation>().Play();
                IsActive = true;
                foreach (var superTarget in Physics
                         .OverlapBox(TrapPrefab.transform.position, GetComponent <BoxCollider>().bounds.size)
                         .Where(T => T.gameObject.tag.Contains("Wolf")))
                {
                    WolfHealth wolf = (WolfHealth)go.GetComponent <WolfHealth>();
                    wolf.takeDamage(Pows[Level - 1]);
                }
                yield return(new WaitForSeconds(2f));

                Durability--;
                if (Durability == 0)
                {
                    Destroy(TrapPrefab);
                }
                IsActive = false;
            }
            yield break;
        }