Esempio n. 1
0
    private void CheckCollider(Collider other)
    {
        if (other.isTrigger && other.GetType().ToString() == "UnityEngine.CapsuleCollider" && !_isFiring)
        {
            EnemyNavNetworkController controller = other.GetComponent <EnemyNavNetworkController>();
            if (controller != null && (!controller.isBowser || controller.IsDizzy))
            {
                _isFiring = true;
                bool isBig = false;
                if (!controller.isBowser)
                {
                    controller.gameObject.SetActive(false);
                    Egg.SetActive(true);
                    scenarioScript.NetworkSpawner.SendShyGuyToOrigin(controller.gameObject);
                }
                else
                {
                    isBig = true;
                    Destroy(controller.gameObject);
                    BigEgg.SetActive(true);
                }

                owner.IncreaseEgg(isBig);
            }
        }
    }
Esempio n. 2
0
    private void ValidateCollider(Collider other)
    {
        EggBehaviour eggBehaviour = other.gameObject.GetComponent <EggBehaviour>();

        if (eggBehaviour != null && eggBehaviour.Owner != transform.gameObject)
        {
            int dizzyTime = 3;
            if (eggBehaviour.IsBig)
            {
                dizzyTime = 6;
            }
            BeDizzy(dizzyTime);
            CmdBeDizzy(dizzyTime);
            return;
        }

        MagicEggBehaviour mEggBehaviour = other.gameObject.GetComponent <MagicEggBehaviour>();

        if (mEggBehaviour != null)
        {
            isWithMagicEgg = true;
            UpdateEggText();
            StartCoroutine(RemoveMagicEgg());
            CmdDestroyMagicEgg(mEggBehaviour.netId);
            Destroy(mEggBehaviour.gameObject);
            return;
        }

        if (other.GetType().ToString() == "UnityEngine.CapsuleCollider")
        {
            EnemyNavNetworkController enemy = other.gameObject.GetComponent <EnemyNavNetworkController>();
            if (enemy != null && !enemy.IsDizzy)
            {
                if (enemy.isBowser)
                {
                    BeDizzy(5);
                    CmdBeDizzy(5);
                }
                else
                {
                    BeDizzy(3);
                    CmdBeDizzy(3);
                }
            }
        }
    }