コード例 #1
0
ファイル: PropUser.cs プロジェクト: smdx24/CPI-Source-Code
        public void OnPropRetrieveCompleted()
        {
            if (PlayerHandle.IsNull)
            {
                return;
            }
            isPropAnimCompleted = true;
            checkRetrieveCompleted();
            HeldObjectsData component = dataEntityCollection.GetComponent <HeldObjectsData>(PlayerHandle);

            if (component != null && component.HeldObject != null)
            {
                HeldObjectType objectType = component.HeldObject.ObjectType;
                if (objectType == HeldObjectType.DURABLE && Prop != null)
                {
                    InteractiveZonePropEventHandler component2 = Prop.GetComponent <InteractiveZonePropEventHandler>();
                    if (component2 != null)
                    {
                        UnityEngine.Object.Destroy(component2);
                    }
                }
            }
            if (Prop != null && Prop.IsOwnerLocalPlayer)
            {
                ParticipationData component3 = dataEntityCollection.GetComponent <ParticipationData>(dataEntityCollection.LocalPlayerHandle);
                if (component3 != null)
                {
                    component3.IsInteractButtonAvailable = true;
                }
            }
        }
コード例 #2
0
    public void OnTriggerExit(Collider other)
    {
        if (!IsTypeAllowed(other))
        {
            return;
        }
        CustomDispatcher component = other.gameObject.GetComponent <CustomDispatcher>();

        if (!(component != null) || component.Dispatcher != Dispatcher)
        {
            return;
        }
        Prop componentInChildren = other.gameObject.GetComponentInChildren <Prop>();

        if (componentInChildren != null)
        {
            InteractiveZonePropEventHandler component2 = componentInChildren.GetComponent <InteractiveZonePropEventHandler>();
            if (component2 != null)
            {
                component2.UnEquipProp();
            }
        }
        Dispatcher.DispatchEvent(new InteractionZoneEvents.InteractionZoneEvent(ZoneId, other, base.gameObject, ZoneInteractionStateChange.ExitZone));
        UnityEngine.Object.Destroy(component);
        CollidersInZone.Remove(other);
    }