Beispiel #1
0
        void Update()
        {
            if (!SceneTown.isModalShow)
            {
                if ((SceneTown.buildingSelected != null) && !UICommand.Visible)
                {
                    UICommand.Show(SceneTown.buildingSelected);
                }
                else if ((SceneTown.buildingSelected == null) && UICommand.Visible)
                {
                    UICommand.Hide();
                }
                else
                {
                }
            }

            if (Visible)
            {
                for (int i = 0; i < Buttons.Count; ++i)
                {
                    Buttons[i].Update();
                }
            }
        }
Beispiel #2
0
        public void BuildingLandUnselect()
        {
            if (buildingSelected == null)
            {
                return;
            }

            buildingSelected.Land(true, true);
            buildingSelected = null;
            Save();

            UICommand.Hide();
        }
Beispiel #3
0
        // select building
        public void BuildingSelect(Building buildingNew)
        {
            // if user select selected building again
            bool SelectSame = (buildingNew == buildingSelected) ? true : false;

            if (buildingSelected != null)
            {
                // if initialy created building, then pass
                if (!buildingSelected.OnceLanded)
                {
                    return;
                }
                // building can't land, then pass
                if (!buildingSelected.Landed && !buildingSelected.Landable)
                {
                    return;
                }

                // land building
                BuildingLandUnselect();
                UICommand.Hide();
            }

            if (SelectSame)
            {
                return;
            }

            buildingSelected = buildingNew;

            if (buildingSelected != null)
            {
                //Debug.Log ("Building Selected:"+buildingNew.gameObject.name+" OnceLanded:"+buildingNew.OnceLanded.ToString ());
                // set scale animation to newly selected building
                BETween bt = BETween.scale(buildingSelected.gameObject, 0.1f, new Vector3(1.0f, 1.0f, 1.0f), new Vector3(1.4f, 1.4f, 1.4f));
                bt.loopStyle = BETweenLoop.pingpong;
                // se tbuilding state unland
                buildingSelected.Land(false, true);
            }
        }