Esempio n. 1
0
        // Update is called once per frame
        void LateUpdate()
        {
            while (pendingSlices.Count > 0)
            {
                PendingSlice pendingSlice = pendingSlices.Dequeue();
                // CheckAXESlice.GetComponent<MeleeWeapon>().HitCount--; // в слайсере проверка на то что слайсер попал по цели и отрубил объекту коллайдер
                var component = pendingSlice.target as MonoBehaviour;

                if (component != null)
                {
                    var targetGameObject = component.gameObject;

                    if (suppressUntilContactCeases.Contains(targetGameObject) == false)
                    {
                        pendingSlice.target.Sliced += PendingSlice_target_Sliced;

                        //  GetComponent<AllZombieAI>().maximumHitPoints = 0;

                        Instantiate(meleeBloodPS, transform.position, Quaternion.identity);

                        CheckAXESlice.GetComponent <MeleeWeapon>().HitCount--;
                        pendingSlice.target.Slice(pendingSlice.point, normalInWorldSpace);
                    }
                }
            }
        }
Esempio n. 2
0
    // Update is called once per frame
    void LateUpdate()
    {
        while (pendingSlices.Count > 0)
        {
            PendingSlice pendingSlice = pendingSlices.Dequeue();

            var targetGameObject = (pendingSlice.target as MonoBehaviour).gameObject;

            if (suppressUntilContactCeases.Contains(targetGameObject) == false)
            {
                GameObject[] result = pendingSlice.target.Slice(pendingSlice.point, normalInWorldSpace);

                if (result.Length > 1)
                {
                    suppressUntilContactCeases.AddRange(result);
                }
            }
        }
    }
Esempio n. 3
0
        // Update is called once per frame
        void LateUpdate()
        {
            while (pendingSlices.Count > 0)
            {
                PendingSlice pendingSlice = pendingSlices.Dequeue();

                var component = pendingSlice.target as MonoBehaviour;

                if (component != null)
                {
                    var targetGameObject = component.gameObject;

                    if (suppressUntilContactCeases.Contains(targetGameObject) == false)
                    {
                        pendingSlice.target.Sliced += PendingSlice_target_Sliced;

                        pendingSlice.target.Slice(pendingSlice.point, normalInWorldSpace);
                    }
                }
            }
        }