Пример #1
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    //  Called each frame.
    /// </summary>
    protected override void Update()
    {
        base.Update();

        // object is active in the world
        if (_ObjectState == WorldObjectStates.Active && IsAlive())
        {
            // Show the healthbar
            ///if (_HealthBar != null) { _HealthBar.gameObject.SetActive(true); }

            // Create a healthbar if the unit doesn't have one linked to it
            ///else { CreateHealthBar(this, _Player.PlayerCamera); }

            // Update current shield hitpoints based on the spire hitpoints
            float points = 0;
            for (int i = 0; i < Spires.Count; i++)
            {
                points += Spires[i].GetHitPoints();
            }
            _ShieldPoints = points;
        }

        // Always show the active state mesh
        if (ActiveState != null)
        {
            ActiveState.SetActive(true);
        }
    }
Пример #2
0
 void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         Debug.Log("Player not near car anymore");
         playerInsideTrigger = false;
         ActiveState.SetActive(GlobalHandler.Instance.upArrow, false);
     }
 }
Пример #3
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         playerInsideTrigger = true;
         //Show Up Arrows
         ActiveState.SetActive(GlobalHandler.Instance.upArrow, true);
     }
 }
Пример #4
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         Debug.Log("Player near copier");
         playerInsideTrigger = true;
         //Show Help - Up Arrows
         ActiveState.SetActive(GlobalHandler.Instance.upArrow, true);
     }
 }
Пример #5
0
 void PlayerOutside(bool force)
 {
     if (SneakerPlayer.mySecretPlace == gameObject || force)
     {
         ActiveState.SetActive(GlobalHandler.Instance.upArrow, false);
         // Reset copier display
         copierSpriteAnimation.SetAnimation("idle");
         hidden = false;
         SneakerPlayer.mySecretPlace = null;
     }
 }
Пример #6
0
 void PlayerOutside()
 {
     playerInsideTrigger = false;
     playerRb.useGravity = true;
     //player.mySecretPlace = null;
     ActiveState.SetActive(GlobalHandler.Instance.upArrow, false);
     ActiveState.SetActive(GlobalHandler.Instance.downArrow, false);
     // Sound set
     if (GlobalHandler.Instance.fxSource.isPlaying)
     {
         GlobalHandler.Instance.fxSource.Stop();
     }
     GlobalHandler.Instance.fxSource.loop = false;
     // */
 }
Пример #7
0
    // Use this for initialization
    public virtual void Start()
    {
        player            = GameObject.FindGameObjectWithTag("Player");
        triggerSphere     = GetComponent <SphereCollider>();
        initialPosition   = transform.position;
        mySource          = GetComponent <AudioSource>();
        myRenderer        = GetComponent <Renderer>();
        currentLevelIndex = 0;

        if (player == null || triggerSphere == null)
        {
            ActiveState.SetActive(gameObject, false);
        }

        UpdateLevelMonsterData();
    }
Пример #8
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         Debug.Log("Player near ladder");
         playerInsideTrigger = true;
         playerRb.useGravity = false;
         //player.mySecretPlace = gameObject;
         //Show Up and Down Arrows
         //GlobalHandler.Instance.help.transform.position = GlobalHandler.Instance.player.transform.position;
         ActiveState.SetActive(GlobalHandler.Instance.downArrow, true);
         ActiveState.SetActive(GlobalHandler.Instance.upArrow, true);
         // Sound set
         if (GlobalHandler.Instance.fxSource.isPlaying)
         {
             GlobalHandler.Instance.fxSource.Stop();
         }
         GlobalHandler.Instance.fxSource.loop = true;
         GlobalHandler.Instance.fxSource.clip = ladderStep;
     }
 }