public void AddNpcAction(NpcAction npcAction) { if (System.Object.ReferenceEquals(npcAction, null)) { return; } NpcMgr npcMgr = GetNpcMgr(npcAction.NpcActionStatus); if (System.Object.ReferenceEquals(npcMgr, null)) { return; } npcMgr.AddNpcAction(npcAction); }
private static void NNN(NpcMgr npcMgr, Transform npcActionStatusTrans, System.UInt16 stationIndex) { int npcCount = npcActionStatusTrans.childCount; for (int i = 0; i < npcCount; ++i) { Transform npcTrans = npcActionStatusTrans.GetChild(i); NpcAction npcAction = npcTrans.GetComponent <NpcAction> (); if (npcAction == null) { continue; } // int npcId = Interlocked.Increment(ref StationEngine.StartNpcId); //原子操作 // npcAction.NpcId = npcId; npcAction.StationIndex = stationIndex; npcMgr.AddNpcAction(npcAction); } }