Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (Health.GetValue() <= 0)
     {
         GetComponent <Text>().text = "DEAD";
     }
 }
 // Update is called once per frame
 void Update()
 {
     Count += Time.deltaTime;
     if (Count >= Timer.GetValue())
     {
         Speed = Speed * -1;
         Count = 0;
     }
     position.x = Speed * Time.deltaTime;
     controller.Move(position);
 }
Пример #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Zombie")
        {
            Health.SubValue(.1f);
        }

        if (Health.GetValue() <= 0)
        {
            GetComponent <ParticleSystem>().enableEmission = true;
            gameObject.SetActive(false);
            RestartButton.transform.localScale = new Vector3(1, 1, 1);
        }
    }
Пример #4
0
    public override NodeResult Execute()
    {
        KeyCheck();
        AITargeter s = source as AITargeter;
        float      t = times[s];

        if (Time.time > t)
        {
            Transform tr = Instantiate((Transform)bullet.GetValue(), s.transform.position, s.transform.rotation);
            tr.GetComponent <AITargeter>().OnSpawned(s.GetComponentInParent <TreeBehaviour>());
            //tr.GetComponent<AITargeter>().OnSpawned(s);
            t = Time.time + (float)rate.GetValue();
        }
        times[source as AITargeter] = t;
        return(NodeResult.Success);
    }
    public override NodeResult Execute()
    {
        KeyCheck();
        AITargeter s = source as AITargeter;
        float      t = times[s];

        if (Time.time > t)
        {
            Vector3[] pts = CircleMotion.GenerateCircleOfDirections(1, this.pts);
            for (int i = 0; i < this.pts; i++)
            {
                Transform b = Instantiate((Transform)bullet.GetValue(), s.transform.position, new Quaternion());
                b.up = pts[i];
            }
            t = Time.time + (float)rate.GetValue();
        }
        times[source as AITargeter] = t;
        return(NodeResult.Success);
    }
Пример #6
0
 // Update is called once per frame
 void Update()
 {
     HealthImage.fillAmount = HealthLevel.GetValue();
 }
Пример #7
0
 // Update is called once per frame
 void Update()
 {
     healthBar.fillAmount = PlayerHealth.GetValue();
 }