Ejemplo n.º 1
0
        protected WorldObject actor;  //Object that uses (is capable of) this action

        //private Texture2D cursorTex = null;
        //public Texture2D cursor { get { return ResourceManager.loadTexture(ref cursorTex, HoverCursor); } }

        public Action(string def, WorldObject act)
        {
            if (act)
            {
                actor = act;
            }
            else
            {
                Debug.LogError("Action with no parent object!");
            }

            if (def.Length > 0)
            {
                this.def = DefStorage.getDef(def) as ActionDef;
            }
            else
            {
                this.def = DefStorage.getDef(getDefName()) as ActionDef;
            }
            if (this.def == null)
            {
                this.def = new ActionDef();
            }
            //this.def = ResourceManager.
            menuImage = new LazyResource <Texture2D>(this.def.MenuIcon);
            //Init def
            //InitDef();
        }
Ejemplo n.º 2
0
 protected virtual void Start()
 {
     if (!storInitiated)
     {
         DefStorage.init(gameObject);
         storInitiated = true;
     }
 }
Ejemplo n.º 3
0
        public Def(string name)
        {
            //text2D = new Dictionary<string,Texture2D>();

            DefStorage.registerDef(this);
        }