public void SpawnNpc(int cfgid, Vector3 pos, Quaternion rot) { PrefabsConfig config = ConfigDataMgr.Instance.PrefabCfgLoader.GetDataByID(cfgid); if (!System.Object.ReferenceEquals(null, config)) { GameObject go = PrefabsAssetHolder.Instance.GetPrefabByID(config.ID); if (go) { GameObject npcInstance = PrefabPoolingSystem.Instance.Spawn(go, pos, rot); npcInstance.transform.SetParent(RoleContenter); SimWood sw = npcInstance.GetComponent <SimWood>(); if (sw) { sw.Home = NPC_Home; sw.Food = NPC_Food; } } } }
public override void TakeEffect(SimWood target) { if (target) { target.Xue = target.Xue - 10; } }
public virtual SimWood GetAffectTarget(Transform trans) { SimWood target = trans.GetComponent <SimWood>(); if (!target) { trans = trans.parent; if (trans) { target = trans.GetComponent <SimWood>(); } } if (target) { if (target.ID != OwnerID) { Debug.Log("$$$ bullet collider" + ID.ToString()); return(target); } } return(null); }
public virtual bool AddToTarget(SimWood target) { if (!System.Object.ReferenceEquals(null, target)) { if (target.AddItem(ItemCfgID, Count)) { return(true); } } return(false); }
private void OnTriggerEnter(Collider other) { if (other && other.transform && other.transform.parent) { SimWood sw = other.transform.parent.GetComponent <SimWood>(); if (!System.Object.ReferenceEquals(null, sw)) { // sw.Bag.AddItem(id); if (AddToTarget(sw)) { OnAddSuccess(sw); } } } }
private void LoadUIContent() { if (!IsUIElementsReady) { return; } UILord.Instance.CurBagUI = this; SimWood sw = (SimWood)EntityManager.Instance.PlayerEntity; if (!System.Object.ReferenceEquals(null, sw)) { Bag = sw.Bag; UILord.Instance.CurBag = Bag; LoadBagContent(Bag); } }
private void LoadUIContent() { if (!IsUIElementsReady) { return; } UILord.Instance.CurRoleInfoUI = this; SimWood sw = (SimWood)EntityManager.Instance.PlayerEntity; if (!System.Object.ReferenceEquals(null, sw)) { RoleInfo = sw.RoleInfo; UILord.Instance.CurRoleInfo = RoleInfo; LoadContent(RoleInfo); } }
private void LoadUIContent() { if (!IsUIElementsReady) { return; } SimWood sw = (SimWood)EntityManager.Instance.PlayerEntity; if (!System.Object.ReferenceEquals(null, sw)) { Shortcut = sw.Shortcut; UILord.Instance.CurShortcut = Shortcut; UILord.Instance.CurShortcutUI = this; LoadContent(Shortcut); } }
public virtual void HandleTargetStay(SimWood target) { }
public virtual void AfterEffect(SimWood target) { }
public virtual void TakeEffect(SimWood target) { target.Xue = target.Xue - 10; }
public virtual void HandleTargetExit(SimWood target) { }
public override void HandleTargetEnter(SimWood target) { //base.HandleTargetEnter(target); TakeEffect(target); }
public virtual void HandleTargetEnter(SimWood target) { TakeEffect(target); AfterEffect(target); }
public virtual void OnAddSuccess(SimWood target) { PrefabPoolingSystem.Instance.Despawn(gameObject); }
// Start is called before the first frame update void Start() { GameLogicSupvisor.Instance.Register(this); Wood = GetComponent <SimWood>(); }
public override void HandleTargetExit(SimWood target) { }
public override void HandleTargetStay(SimWood target) { }