public override void OnExit() { base.OnExit(); CurrentActor.EnableCollider(true); CurrentActor.Props.SetProperty_Int32(ENProperty.islive, 1); CurrentActor.SetCurHP(CurrentActor.MaxHP); }
public override bool OnUpdate() { if (ActorType.enNPC == CurrentActor.Type) { NPC npc = CurrentActor as NPC; float fDuration = 3.0f; if (npc.GetNpcType() == ENNpcType.enBoxNPC) {//宝箱永远不消失 fDuration = float.MaxValue; } else { if (npc.NpcBehaviour) { fDuration = npc.NpcBehaviour.DeadDuration; } fDuration += AnimLength; } if (Time.time - AnimStartTime > fDuration) { CurrentActor.MainRigidBody.isKinematic = m_isKinematic; ActorManager.Singleton.ReleaseActor(CurrentActor.ID); } if (!IsPlayOver && Time.time - AnimStartTime > AnimLength) { IsPlayOver = true; if (npc.GetNpcType() != ENNpcType.enBOSSNPC) { m_isKinematic = CurrentActor.MainRigidBody.isKinematic; CurrentActor.MainRigidBody.isKinematic = true; } CurrentActor.EnableCollider(false); } } else { float fDuration = AnimLength + 0.3f; if (Time.time - AnimStartTime > fDuration) { CurrentActor.MainRigidBody.isKinematic = m_isKinematic; } if (!IsPlayOver && Time.time - AnimStartTime > AnimLength) { IsPlayOver = true; m_isKinematic = CurrentActor.MainRigidBody.isKinematic; CurrentActor.MainRigidBody.isKinematic = true; CurrentActor.EnableCollider(false); } } return(false); }
public override void OnExit() { CurrentActor.HideMe(); CurrentActor.EnableCollider(true); }
public override void OnExit() { CurrentActor.EnableCollider(true); CurrentActor.MainAnim.cullingType = AnimationCullingType.BasedOnRenderers; }