public void AddLog(string key, BaseUnit nation = null, params object[] objs) { if (!BaseGlobal.IsUnReadData) { return; } if (nation != null) { if (!nation.IsPlayer()) { return; } } BaseLogData tempData = new BaseLogData(); tempData.Date = BaseGlobal.DateTimeMgr.GetCurDateStr(); tempData.Desc = Util.GetStr(key, objs); tempData.ID = IDUtil.Gen(); tempData.CurTime = 0; Data.Insert(0, tempData); if (Data.Count > MaxCount) { RemLastLog(); } Callback_OnAddedLog?.Invoke(tempData); }
//是否AI操作,更加细化 public bool IsAIProcess(BaseUnit unit) { if (Options.IsOnlyPlayerAI) { if (unit.IsPlayer()) { return(true); } return(false); } else { return(true); } }
public AudioSource PlayPlSFX(string clipName, BaseUnit player, Vector3?pos = null, bool isLoop = false, float maxDis = 60.0f) { if (clipName == null) { return(null); } if (player == null) { return(null); } if (!player.IsPlayer()) { return(null); } return(PlaySFX(clipName, pos, isLoop, maxDis)); }