Exemple #1
0
        protected override void OnPickUp(GameObject go)
        {
            RagdollPart ragdollPart = go.GetComponent <RagdollPart>();

            if (ragdollPart)
            {
                if (ragdollPart.root.player)
                {
                    AddItem(ragdollPart.root.player.gameObject);
                }
            }
            else
            {
                AddItem(go);
            }
        }
        ///<inheritdoc/>
        protected override void TriggerAction(Transform other)
        {
            base.TriggerAction(other);
            if (obj)
            {
                RagdollPart ragdollPart = other.GetComponent <RagdollPart>();

                Transform target = ragdollPart ? other.root : other;
                IActor    actor  = target.GetComponent <IActor>();
                if (actor != null)
                {
                    actor.Warp(obj.position);
                }
                else
                {
                    target.position = obj.position;
                }
            }
        }
Exemple #3
0
        ///<inheritdoc/>
        protected override void OnPickUp(GameObject go)
        {
            RagdollPart ragdollPart = go.GetComponent <RagdollPart>();

            if (ragdollPart)
            {
                if (ragdollPart.root.player && ragdollPart.root.player.Heal())
                {
                    base.OnPickUp(go);
                }
            }
            else
            {
                Player player = go.GetComponent <Player>();
                if (player && player.Heal())
                {
                    base.OnPickUp(go);
                }
            }
        }