Beispiel #1
0
        /// <summary>
        /// 付钱
        /// </summary>
        public virtual void Pay(int cash)
        {
            L_Actor_Seat seat = L_ActorManager.It.Find <L_Actor_Seat> (m_SeatID);
            L_Item       item = L_ItemData.CreateItem("Cash", seat.WinePos.position, seat.WinePos.rotation);

            item.GetAttribute("money").Value = cash;

            GameEventMachine.SendEvent(GameEventID.Event_Drinker_Pay, gameObject, cash);
        }
Beispiel #2
0
        public static L_Item CreateItem(string name, Vector3 pos, Quaternion quat)
        {
            if (Instance == null)
            {
                Instance = Resources.Load <L_ItemData>("SerializeableData/ItemData");
            }
            GameObject prefab = Instance.GetItemPrefab(name) as GameObject;

            if (prefab == null)
            {
                return(null);
            }
            GameObject obj = Instantiate(prefab, pos, quat) as GameObject;

            return(obj.GetComponent <L_Item> ());
        }