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;
                    }
                }
            }
        }
Exemplo n.º 2
0
 public override void TakeEffect(SimWood target)
 {
     if (target)
     {
         target.Xue = target.Xue - 10;
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public virtual bool AddToTarget(SimWood target)
        {
            if (!System.Object.ReferenceEquals(null, target))
            {
                if (target.AddItem(ItemCfgID, Count))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 5
0
        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);
                    }
                }
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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);
            }
        }
Exemplo n.º 9
0
 public virtual void HandleTargetStay(SimWood target)
 {
 }
Exemplo n.º 10
0
 public virtual void AfterEffect(SimWood target)
 {
 }
Exemplo n.º 11
0
 public virtual void TakeEffect(SimWood target)
 {
     target.Xue = target.Xue - 10;
 }
Exemplo n.º 12
0
 public virtual void HandleTargetExit(SimWood target)
 {
 }
Exemplo n.º 13
0
 public override void HandleTargetEnter(SimWood target)
 {
     //base.HandleTargetEnter(target);
     TakeEffect(target);
 }
Exemplo n.º 14
0
 public virtual void HandleTargetEnter(SimWood target)
 {
     TakeEffect(target);
     AfterEffect(target);
 }
Exemplo n.º 15
0
 public virtual void OnAddSuccess(SimWood target)
 {
     PrefabPoolingSystem.Instance.Despawn(gameObject);
 }
Exemplo n.º 16
0
        // Start is called before the first frame update
        void Start()
        {
            GameLogicSupvisor.Instance.Register(this);

            Wood = GetComponent <SimWood>();
        }
Exemplo n.º 17
0
 public override void HandleTargetExit(SimWood target)
 {
 }
Exemplo n.º 18
0
 public override void HandleTargetStay(SimWood target)
 {
 }