Exemplo n.º 1
0
    public void Reset()
    {
        ShootScript = m_Instance.GetComponent <TankShooting>();
        m_Instance.transform.position = m_SpawnPoint.position;
        m_Instance.transform.rotation = m_SpawnPoint.rotation;

        ShootScript.m_Ammo = 5;

        m_Instance.SetActive(false);
        m_Instance.SetActive(true);
        ShootScript.SetAmmoUI();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player") || other.CompareTag("AI"))
        {
            int waypointNumber = Random.Range(0, manager.AIWaypoints.Count);
            if (manager.AIWaypoints[waypointNumber].transform.position == HPRefill.refillWaypoint)
            {
                waypointNumber = (waypointNumber + 1) % manager.AIWaypoints.Count;
            }
            refillWaypoint = manager.AIWaypoints[waypointNumber].transform.position;


            //refillWaypoint = manager.AIWaypoints[Random.Range(0, manager.AIWaypoints.Count)].transform.position;
            TankShooting ShootScript = other.GetComponent <TankShooting>();
            //Debug.Log(script.m_Ammo);
            ShootScript.m_Ammo = 5;
            ShootScript.SetAmmoUI();
            this.transform.position = manager.AIWaypoints[waypointNumber].position;
        }
    }