Ejemplo n.º 1
0
    private void Awake()
    {
        _toggles         = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Shape").GetComponentsInChildren <Toggle>();
        _currentWallType = WallsUtils.Walltype.WC; // TODO Set null

        Transform wallObjectProperties = WallObjectProperties.Find("ImageCheatSheet/Properties");
        Transform wallObjectContent    = WallObjectProperties.Find("ImageCheatSheet/ObjectSelected");

        _wallObjectId = wallObjectProperties.Find("Id").gameObject;
        _time         = wallObjectProperties.Find("Time").gameObject;
        // _backgroundImage = wallObjectContent.Find("Shape/ImageBackground").gameObject;
        _shapeImage = wallObjectContent.Find("Shape/ImageBackground/WallImage").gameObject;
        _dodgeImage = wallObjectContent.Find("Dodge/ImageBackground").gameObject;

        _coinImageBackground = wallObjectContent.Find("Coin/ImageBackground").gameObject;
        _coinImage           = wallObjectContent.Find("Coin/ImageBackground/Image").gameObject;

        _currentTab = wallObjectContent.Find("Shape").gameObject;
        _currentTab.SetActive(true);

        WallShape   = new WallShape();
        WallHit     = new WallHit();
        WallDodge   = new WallDodge();
        WallCoin    = new Coin();
        WallCustom  = new WallCustom();
        CurrentWall = WallShape;
    }
Ejemplo n.º 2
0
    public void SelectWallTab(WallsUtils.Walltype wallType, string id = null)
    {
        _currentTab.SetActive(false);

        string currentType = _wallObjectId.GetComponentInChildren <InputField>().text;

        GameObject currentToggleGroup;

        switch (wallType)
        {
        case WallsUtils.Walltype.NONE:
            return;

        case WallsUtils.Walltype.WP:
            // _backgroundImage.GetComponent<Image>().color = new Color32(139, 212, 255, 255);
            _currentTab        = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Shape").gameObject;
            currentToggleGroup = ToggleGroupWallType.Find("Shape").gameObject;
            CurrentWall        = WallShape;
            CurrentWall.Id     = id == null ? CurrentWall.Id : id;

            UpdateUIWallObjectProperties(CurrentWall.Id);
            UpdateUIWallObjectSprite(CurrentWall.Id);
            enableChanges();
            MoveWallObjectSprite();
            UpdateUIToggles(_currentTab);
            break;

        case WallsUtils.Walltype.WA:
            // _backgroundImage.GetComponent<Image>().color = new Color32(22, 11, 111, 255);
            _currentTab        = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Dodge").gameObject;
            currentToggleGroup = ToggleGroupWallType.Find("Dodge").gameObject;
            // ChangeToggle(currentToggleGroup);

            CurrentWall    = WallDodge;
            CurrentWall.Id = id == null ? CurrentWall.Id : id;

            UpdateUIWallObjectProperties(CurrentWall.Id);
            UpdateDodgeSprite(CurrentWall.Id);
            UpdateUIToggles(_currentTab);

            break;

        case WallsUtils.Walltype.WH:
            // _backgroundImage.GetComponent<Image>().color = new Color32(191, 39, 45, 255);
            // _image.GetComponent<Image>().color = new Color32(191, 39, 45, 255);
            _currentTab        = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Hit").gameObject;
            currentToggleGroup = ToggleGroupWallType.Find("Hit").gameObject;
            // ChangeToggle(currentToggleGroup);
            CurrentWall    = WallHit;
            CurrentWall.Id = id == null ? CurrentWall.Id : id;

            UpdateUIWallObjectProperties(CurrentWall.Id);
            UpdateUIToggles(_currentTab);
            UpdateLibraryChangeHits(CurrentWall.Id);

            break;

        case WallsUtils.Walltype.WC:
            /*_currentTab = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Custom").gameObject;
             * currentToggleGroup = ToggleGroupWallType.Find("Custom").gameObject;
             * CurrentWall = WallCustom;
             * CurrentWall.Id = id == null ? CurrentWall.Id : id;
             *
             * UpdateUIWallObjectProperties(CurrentWall.Id);
             * UpdateUIToggles(_currentTab);
             * UpdateLibraryChangeHits(CurrentWall.Id);*/

            return;

        case WallsUtils.Walltype.CN:
            // _backgroundImage.GetComponent<Image>().color = new Color32(22, 33, 44, 255);
            _currentTab        = ObjectsLibrary.Find("ImageCheatSheet/ObjectSelected/Coin").gameObject;
            currentToggleGroup = ToggleGroupWallType.Find("Coin").gameObject;
            // ChangeToggle(currentToggleGroup);
            CurrentWall    = WallCoin;
            CurrentWall.Id = id == null ? CurrentWall.Id : id;


            UpdateUIWallObjectProperties(CurrentWall.Id);
            UpdateCoin(WallCoin.X, WallCoin.Y);
            break;

        case WallsUtils.Walltype.EV:
            return;

        default:
            return;
        }
        ChangeToggle(currentToggleGroup);



        _currentTab.SetActive(true);
    }