public override void OnOpen(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
        {
            base.OnOpen(InteractionSelf, interaction);

            if (interaction == null)
            {
                return;
            }
            if (InteractionSelf == null)
            {
                return;
            }
            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            if (IsLimit)
            {
                return;
            }

            interaction.FeaturesObjectController.SetParent(Parent, localPosition, localRotation);
            IsOpen = true;
        }
示例#2
0
 void OnDistanceRelesae(DistanceInteraction interaction)
 {
     if (Interaction == null)
     {
         return;
     }
     if (Interaction.IsGrab && !IsSelf)
     {
         return;
     }
     if (Interaction.AutoDetection)
     {
         if (!Interaction.HasDeteced)
         {
             Interaction.HasDeteced = true;
         }
     }
     if (IsOpen)
     {
         shadowController?.CloseGhost();
         IsOpen = false;
         //    if (Interaction.FeaturesObjectController.ActiveShadow)
         //    {
         //        Interaction.FeaturesObjectController.ShadowController.CloseGhost();
         //        IsOpen = false;
         //    }
     }
 }
        public override void OnOpen(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
        {
            base.OnOpen(InteractionSelf, interaction);

            if (interaction == null)
            {
                return;
            }
            if (InteractionSelf == null)
            {
                return;
            }

            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            if (!IsOpen && !IsLimit)
            {
                if (InteractionSelf.FeaturesObjectController.ActiveShadow)
                {
                    InteractionSelf.FeaturesObjectController.ShadowController.OpenGhost(interaction.FeaturesObjectController.transform,
                                                                                        localPosition, localScale, Quaternion.Euler(localRotation));

                    IsOpen = true;
                }
            }
        }
示例#4
0
        void OnDistanceStay(DistanceInteraction interaction)
        {
            if (Interaction == null)
            {
                return;
            }
            if (Interaction.AutoDetection)
            {
                if (!Interaction.HasDeteced)
                {
                    return;
                }
            }
            if (Interaction.IsGrab && !IsSelf)
            {
                return;
            }

            if (!IsOpen && !IsLimit)
            {
                //if (Interaction.FeaturesObjectController.ActiveShadow)
                //{

                if (shadowController != null)
                {
                    shadowController.Init(Interaction.transform.parent, traModelNode, Color.yellow, 0.25f, 3000, traModelNode ? ShadowType.Manual : ShadowType.Auto);
                    shadowController.OpenGhost(interaction.FeaturesObjectController.transform,
                                               localPosition, localScale, Quaternion.Euler(localRotation));
                }
                IsOpen = true;
            }
        }
示例#5
0
        public override void OnDistanceRelesae(DistanceInteraction distanceInteraction)
        {
            if (Equipment == null)
            {
                return;
            }
            //if (!IsCanInteraction(distanceInteraction)) return;

            base.OnDistanceRelesae(distanceInteraction);

            Equipment.OnDistanceRelease((InteractionEquipment)distanceInteraction.ExternalInteraction);
        }
示例#6
0
        void OnDistanceExit(DistanceInteraction interaction)
        {
            if (interaction == null)
            {
                return;
            }
            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            interaction.FeaturesObjectController.SetParent(null);
        }
示例#7
0
        private void Start()
        {
            if (InteractionSelf == null)
            {
                InteractionSelf = GetComponent <DistanceInteraction>();
            }

            if (InteractionSelf == null)
            {
                return;
            }

            InteractionSelf.OnRelease.AddListener(OnDistanceRelesae);
            InteractionSelf.OnExit.AddListener(OnDistanceExit);
        }
示例#8
0
        public override void OnDistanceExit(DistanceInteraction distanceInteraction)
        {
            if (Equipment == null)
            {
                return;
            }

            if (!(distanceInteraction.ExternalInteraction is InteractionEquipment))
            {
                return;
            }

            base.OnDistanceExit(distanceInteraction);

            Equipment.OnDistanceExit((InteractionEquipment)distanceInteraction.ExternalInteraction);
        }
示例#9
0
        public override void OnDistanceRelease(DistanceInteraction distanceInteraction, InteractionReleaseStatus status)
        {
            if (Equipment == null)
            {
                return;
            }
            base.OnDistanceRelease(distanceInteraction, status);

            if (status == InteractionReleaseStatus.None)
            {
                Equipment.OnDistanceRelease(null, status);
                return;
            }

            Equipment.OnDistanceRelease((InteractionEquipment)distanceInteraction.ExternalInteraction, status);
        }
示例#10
0
        private void Start()
        {
            if (Interaction == null)
            {
                Interaction = GetComponent <DistanceInteraction>();
            }

            if (Interaction == null)
            {
                return;
            }

            Interaction.OnStay.AddListener(OnDistanceStay);
            Interaction.OnExit.AddListener(OnDistanceExit);
            Interaction.OnRelease.AddListener(OnDistanceRelesae);
            //Interaction.OnRelesaeReset.AddListener(OnDistanceRelesae);
        }
示例#11
0
 void OnDistanceExit(DistanceInteraction interaction)
 {
     if (Interaction == null)
     {
         return;
     }
     if (Interaction.IsGrab && !IsSelf)
     {
         return;
     }
     if (IsOpen && !IsLimit)
     {
         if (Interaction.FeaturesObjectController.ActiveShadow)
         {
             Interaction.FeaturesObjectController.ShadowController.CloseGhost();
             IsOpen = false;
         }
     }
 }
示例#12
0
        public override void OnClose(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
        {
            base.OnClose(InteractionSelf, interaction);

            if (InteractionSelf == null)
            {
                return;
            }
            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            if (IsOpen)
            {
                shadowController.CloseGhost();
                IsOpen = false;
            }
        }
示例#13
0
        public override bool IsCanInteraction(DistanceInteraction distanceInteraction)
        {
            if (Equipment == null)
            {
                return(true);
            }

            if (!(distanceInteraction.ExternalInteraction is InteractionEquipment))
            {
                return(false);
            }

            bool result = Equipment.IsCanInteraction((InteractionEquipment)distanceInteraction.ExternalInteraction);

            foreach (var item in Limits)
            {
                item.IsLimit = !result;
            }

            return(result);
        }
示例#14
0
        public override void OnClose(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
        {
            base.OnClose(InteractionSelf, interaction);

            if (interaction == null)
            {
                return;
            }
            if (InteractionSelf == null)
            {
                return;
            }
            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            interaction.FeaturesObjectController.SetParent(null);

            IsOpen = false;
        }
示例#15
0
        void OnDistanceStay(DistanceInteraction interaction)
        {
            if (Interaction == null)
            {
                return;
            }

            if (Interaction.IsGrab && !IsSelf)
            {
                return;
            }

            if (!IsOpen && !IsLimit)
            {
                if (Interaction.FeaturesObjectController.ActiveShadow)
                {
                    Interaction.FeaturesObjectController.ShadowController.OpenGhost(interaction.FeaturesObjectController.transform,
                                                                                    localPosition, localScale, Quaternion.Euler(localRotation));

                    IsOpen = true;
                }
            }
        }
示例#16
0
        void OnDistanceRelesae(DistanceInteraction interaction)
        {
            if (interaction == null)
            {
                return;
            }

            if (InteractionSelf.IsGrab && !IsSelf)
            {
                return;
            }

            if (IsLimit)
            {
                return;
            }

            //Debug.Log("抓取:" + interaction.IsGrab);

            //Debug.Log("本身:" + interaction.FeaturesObjectController.name);
            //Debug.Log("对方:" + interaction.FeaturesObjectController.name);

            interaction.FeaturesObjectController.SetParent(Parent, localPosition, localRotation);
        }
示例#17
0
 /// <summary>
 /// 打开
 /// </summary>
 public virtual void OnOpen(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
 {
 }
示例#18
0
 /// <summary>
 /// 关闭
 /// </summary>
 public virtual void OnClose(DistanceInteraction InteractionSelf, DistanceInteraction interaction)
 {
 }