Exemplo n.º 1
0
        public void Initialize(DrawerController controller, Option option)
        {
            this.Controller = controller;
            this.Option     = option;

            this.Dragging = false;
        }
Exemplo n.º 2
0
        public static GameObject CreateOption(PuzzleEditor editor, DrawerController controller,
                                              Object prefab, Transform parent, string name, bool ableToEdit)
        {
            GameObject newObj = (GameObject)GameObject.Instantiate(prefab, parent);

            newObj.name = name;

            Initialize(editor, controller, newObj.transform, ableToEdit, name);

            return(newObj);
        }
Exemplo n.º 3
0
        private static void Initialize(PuzzleEditor editor, DrawerController controller, Transform newObj, bool ableToEdit, string name)
        {
            GameObject buttons = newObj.Find("PlusMinus").gameObject;

            Transform resource = newObj.Find("Resource");
            Transform sprite   = resource.Find("Sprite");

            Text   amountText = resource.Find("Amount").GetComponent <Text>();
            Option optionScp  = newObj.GetComponent <Option>();

            Draggable draggable = sprite.GetComponent <Draggable>();

            InitializeButtons(buttons, ableToEdit);
            InitiliazeSprite(sprite, name);
            draggable.Initialize(controller, optionScp);
            optionScp.Initialize(editor, name, amountText, draggable, ableToEdit);
        }