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; }
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; } } }
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; } }
public override void OnDistanceRelesae(DistanceInteraction distanceInteraction) { if (Equipment == null) { return; } //if (!IsCanInteraction(distanceInteraction)) return; base.OnDistanceRelesae(distanceInteraction); Equipment.OnDistanceRelease((InteractionEquipment)distanceInteraction.ExternalInteraction); }
void OnDistanceExit(DistanceInteraction interaction) { if (interaction == null) { return; } if (InteractionSelf.IsGrab && !IsSelf) { return; } interaction.FeaturesObjectController.SetParent(null); }
private void Start() { if (InteractionSelf == null) { InteractionSelf = GetComponent <DistanceInteraction>(); } if (InteractionSelf == null) { return; } InteractionSelf.OnRelease.AddListener(OnDistanceRelesae); InteractionSelf.OnExit.AddListener(OnDistanceExit); }
public override void OnDistanceExit(DistanceInteraction distanceInteraction) { if (Equipment == null) { return; } if (!(distanceInteraction.ExternalInteraction is InteractionEquipment)) { return; } base.OnDistanceExit(distanceInteraction); Equipment.OnDistanceExit((InteractionEquipment)distanceInteraction.ExternalInteraction); }
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); }
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); }
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; } } }
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; } }
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); }
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; }
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; } } }
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); }
/// <summary> /// 打开 /// </summary> public virtual void OnOpen(DistanceInteraction InteractionSelf, DistanceInteraction interaction) { }
/// <summary> /// 关闭 /// </summary> public virtual void OnClose(DistanceInteraction InteractionSelf, DistanceInteraction interaction) { }