public void TryClimbLadder(Pathea.PeCmpt who) { Pathea.OperateCmpt oper = who.Entity.operateCmpt; if (oper == null || oper.HasOperate) { return; } if (null == oper.Entity.motionMgr) { return; } if (oper.Entity.motionMgr.IsActionRunning(Pathea.PEActionType.Climb)) { climb.opClimb.StopOperate(oper, Pathea.Operate.EOperationMask.ClimbLadder); } else { climb.opClimb.StartOperate(oper, Pathea.Operate.EOperationMask.ClimbLadder); } // if (climb.opClimb.IsIdle ()) { // climb.opClimb.StartOperate(oper, Pathea.Operate.EOperationMask.ClimbLadder); // } else { // climb.opClimb.StopOperate(oper, Pathea.Operate.EOperationMask.ClimbLadder); // } }
public override void Update() { int n = _cmpts.Count; for (int i = n - 1; i >= 0; i--) { PeCmpt cmpt = _cmpts[i]; if (cmpt != null && !cmpt.Equals(null)) { if (cmpt.isActiveAndEnabled) { cmpt.OnUpdate(); } } else { _cmpts.RemoveAt(i); } } }
public void RemoveCmpt(PeCmpt cmpt) { _cmpts.Remove(cmpt); }
public void AddCmpt(PeCmpt cmpt) { _cmpts.Add(cmpt); }