private void FindSpirit()
    {
        WingedSpiritController spiritControl = FindObjectOfType <WingedSpiritController>();

        if (spiritControl != null)
        {
            spirit = spiritControl.gameObject;
        }
    }
Example #2
0
    private void OnTriggerStay(Collider other)
    {
        if (NetworkManager.Instance.IsViewMine(photonView))
        {
            WingedSpiritController spiritCon = other.gameObject.GetComponent <WingedSpiritController>();

            if (spiritCon != null)
            {
                spiritCon.SpiritTakeDamageCall(damage);
            }
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        WingedSpiritController spiritController = other.gameObject.GetComponent <WingedSpiritController>();

        if (spiritController != null)
        {
            spiritController.SpiritTakeDamageCall(damage);
        }

        if (!other.GetComponent <BlockChanger>() || Vector3.Distance(transform.position, startPos) > 40)
        {
            if (NetworkManager.Instance.IsViewMine(photonView))
            {
                NetworkManager.Instance.DestroyGameObject(this.gameObject);
            }
        }
    }
Example #4
0
    private void Update()
    {
        if (GameManager.Instance.wingedSpirit != null)
        {
            if (spirit == null)
            {
                spirit = GameManager.Instance.wingedSpirit.GetComponent <WingedSpiritController>();
            }
        }
        else
        {
            spirit = null;
        }

        if (spirit != null)
        {
            healthValueText.text = spirit.health.ToString();
            timeValueText.text   = spirit.secondsAlive.ToString("0.00") + " Seconds";
        }
        else
        {
            healthValueText.text = "0";
        }
    }