Ejemplo n.º 1
0
    private void OnCollisionExit(Collision collision)
    {
        GameObject target = collision.gameObject;

        switch (target.tag)
        {
        case "Hazard":
            StrafingPillar data = target.GetComponent <StrafingPillar>();
            if (unit_class == Class.Defender)
            {
                data.Blocked = false;
            }
            break;
        }
    }
Ejemplo n.º 2
0
    private void OnCollisionStay(Collision collision)
    {
        GameObject target = collision.gameObject;

        switch (target.tag)
        {
        case "Hazard":
            StrafingPillar data = target.GetComponent <StrafingPillar>();
            if (unit_class != Class.Defender)
            {
                Destroy(light);
                transform.position = spawnLocation;
                waypoints.Clear();
                agent.isStopped = true;
                Debug.Log("Hit hazard - resetting location of" + name);
            }

            if (unit_class == Class.Defender)
            {
                data.Blocked = true;
            }
            break;
        }
    }