Ejemplo n.º 1
0
    /*
     * IEnumerator LoadDataCo() {
     *
     *      yield return new WaitForSeconds(.1f);
     *
     *      if (listGridRoot != null) {
     *  foreach (Transform item in listGridRoot.transform) {
     *      Destroy(item.gameObject);
     *  }
     *
     *              List<AppContentAsset> assets = AppContentAssets.Instance.GetAll();
     *
     *      LogUtil.Log("Load AppContentAsset: assets.Count: " + assets.Count);
     *
     *              int i = 0;
     *
     *              int totalPoints = 0;
     *
     *      foreach(AppContentAsset asset in assets) {
     *
     *          GameObject item = NGUITools.AddChild(listGridRoot, listItemPrefab);
     *          item.name = "AssetItem" + i;
     *          item.transform.FindChild("LabelName").GetComponent<UILabel>().text = asset.display_name;
     *          //item.transform.FindChild("LabelDescription").GetComponent<UILabel>().text = achievement.description;
     *
     *                      GameObject gameLevelItemObject = item.transform.FindChild("GameLevelItemObject").gameObject;
     *
     *                      // clear current items
     *
     *                      foreach(Transform t in gameLevelItemObject.transform) {
     *                              Destroy(t.gameObject);
     *                      }
     *
     *                      GameObject go = GameShooterController.Instance.LoadSpriteUI(
     *                              gameLevelItemObject, asset.code, Vector3.one);
     *                      gameLevelItemObject.ChangeLayersRecursively("UILayer");
     *
     *                      float maxSize = 3;
     *
     *                      if(go != null) {
     *                              PackedSprite sprite = go.GetComponent<PackedSprite>();
     *                              if(sprite != null) {
     *
     *                                      float adjust = 1;
     *
     *                                      if(sprite.height > sprite.width) {
     *                                              if(sprite.height > maxSize) {
     *                                                      adjust = maxSize/sprite.height;
     *                                              }
     *                                      }
     *                                      else {
     *                                              if(sprite.width > maxSize) {
     *                                                      adjust = maxSize/sprite.width;
     *                                              }
     *                                      }
     *
     *                                      go.transform.localScale = go.transform.localScale.WithX(adjust).WithY(adjust).WithZ(adjust);
     *                              }
     *                      }
     *
     *                      item.transform.FindChild("ButtonGameLevelItemObject").GetComponent<UIButton>().name
     *                                      = "ButtonGameLevelItemObject$" + asset.code; ///levels[y].name;
     *
     *                      i++;
     *      }
     *
     *      yield return new WaitForEndOfFrame();
     *      listGridRoot.GetComponent<UIGrid>().Reposition();
     *      yield return new WaitForEndOfFrame();
     *
     * }
     * }
     */

    void OnInputClickEventHandler(string inputName, int cam)
    {
        LogUtil.Log("OnInputClickEventHandler: inputName:" + inputName);

        if (inputName == inputSprite.name)
        {
            actionState = UIPanelEditAssetActionState.SELECT_ITEM;
            GameDraggableEditor.ShowUIPanelDialogItems();
        }
        else if (inputName == inputSpriteEffect.name)
        {
            actionState = UIPanelEditAssetActionState.SELECT_EFFECT;
            GameDraggableEditor.ShowUIPanelDialogItems();
        }
    }
Ejemplo n.º 2
0
    void OnButtonClickEventHandler(string buttonName)
    {
        if (itemAsset != null)
        {
            if (buttonName == buttonGameEditAssetSave.name)
            {
                SaveDataAsset();
                ////GameDraggableEditor.ResetAssetPanelRemoveDeselect();
                actionState = UIPanelEditAssetActionState.NONE;
            }
            else if (buttonName == buttonGameEditAssetDelete.name)
            {
                GameDraggableLevelItem levelItem = GameDraggableEditor.GetCurrentDraggableLevelItem();
                if (levelItem != null)
                {
                    levelItem.DestroyMeAnimated();
                }

                ////GameDraggableEditor.ResetAssetPanelRemoveDeselect();
                actionState = UIPanelEditAssetActionState.NONE;
            }
            else if (buttonName == buttonGameEditAssetDeselect.name)
            {
                ////GameDraggableEditor.ResetAssetPanelRemoveDeselect();
                actionState = UIPanelEditAssetActionState.NONE;
            }
            else if (buttonName == buttonGameEditAssetSprite.name)
            {
                actionState = UIPanelEditAssetActionState.SELECT_ITEM;
                GameDraggableEditor.ShowUIPanelDialogItems();
            }
            else if (buttonName == buttonGameEditAssetSpriteEffect.name)
            {
                actionState = UIPanelEditAssetActionState.SELECT_EFFECT;
                GameDraggableEditor.ShowUIPanelDialogItems();
            }

            else if (buttonName == buttonGameEditAssetRotationReset.name)
            {
                UpdateRotation(0f, false, false);
            }
        }
    }