예제 #1
0
    // Checks found object for "Shootable" tag
    // void -> void
    public void CheckForShootable()
    {
        GameObject newObject, oldObject;

        if (raycastManager.GetCurrentFoundObject())
        {
            newObject = raycastManager.GetCurrentFoundObject();

            if (_currentFoundObject != newObject)
            {
                _currentFoundObject = newObject;

                if (_currentFoundObject.tag == "Shootable")
                {
                    ChangeShapeColor(_currentFoundObject);
                }
            }
        }

        if (raycastManager.GetPreviousFoundObject())
        {
            oldObject = raycastManager.GetPreviousFoundObject();

            if (oldObject.tag == "Shootable")
            {
                _previousFoundObject = oldObject;
                RevertShapeColor(_previousFoundObject);
            }
        }
    }
예제 #2
0
    /*
     * Checks if current object seen by reticle is an enemy
     * void -> void
     */
    public void CheckFoundForEnemy()
    {
        GameObject currentObject = _raycastManager.GetCurrentFoundObject();

        if (currentObject.tag == "Enemy" || currentObject.tag == "Turret" || currentObject.tag == "Glow")
        {
            _isEnemy = true;
        }
        else
        {
            _isEnemy = false;
        }
    }
예제 #3
0
 public void TerminateEnemy()
 {
     _shotObject = _raycastManager.GetCurrentFoundObject();
     StopEnemyActions();
     StartCoroutine(FadeEffect());
 }