//public static HelpPipeCon Instance; // private static HelpPipeCon _instance; // // /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // /// // // Static singleton property // public static HelpPipeCon Instance // { // // Here we use the ?? operator, to return 'instance' if 'instance' does not equal null // // otherwise we assign instance to a new component and return that // get // { // if(_instance == null) // { // GameObject obj = new GameObject (); // obj.hideFlags = HideFlags.HideAndDontSave; // _instance = obj.AddComponent<HelpPipeCon> (); // } // // return _instance; // } // } /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Use this for initialization void Awake () { Instance = this; helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>(); ts = TextScript.Instance; helpState = 0; efm = EffectSoundManagerScript.Instance; go_HState = new GameObject[12]; for(int i=0; i<12; i++) { go_HState[i] = GameObject.Find("HStage"+i); } // Debug.Log("1"); // gd = GlobalData.Instance; // gameCon = GameCon.Instance;//GameObject.Find ("GameCon").GetComponent<GameCon>(); go_popup = GameObject.Find("Popup_Help"); gd = GlobalData.Instance; gd.setTileNum(0, true); // help_PipeIndex = 173; // setHelpPipe(help_PipeIndex); // // //// TweenPosition twPosition = TweenPosition.Begin(go_popup, 0.3f, new Vector3(0, 0, 0)); //// twPosition.method = UITweener.Method.BounceIn; }
// Use this for initialization void Awake () { efm = EffectSoundManagerScript.Instance; ts = TextScript.Instance; scrollBar = GameObject.Find ("ScrollBar"); helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>(); //hpc.InitPopup(); go_Popup_Help = GameObject.Find("Popup_Help"); GameCon.bgNum = Random.Range (0, 7); GameCon.setBgAtlasSet (GameCon.bgNum); setBg (); // buy pop-up Popup_Panel_Buy_Obj = GameObject.Find ("Popup_Panel_Buy"); Popup_Panel_Buy_Obj.SetActive (false); //info popup Initialize..................................................................... Popup_Panel_Obj = GameObject.Find ("Popup_Info"); Popup_Panel_Obj.SetActive (false); Popup_Panel_OK_Obj = GameObject.Find ("Popup_Info_OK"); Popup_Panel_OK_Obj.SetActive (false); popupState = 0; //no popup //end info popup Initialize..................................................................... pd = PlayerData.Instance; btnIndex = 0; //tempBuyCount = new int[PlayerData.PIPE_ITEM_MAX] ; item = new GameObject[PlayerData.PIPE_ITEM_MAX]; posCount = new GameObject[PlayerData.PIPE_ITEM_MAX]; posMaxCount = new GameObject[PlayerData.PIPE_ITEM_MAX]; costLabel = new GameObject[PlayerData.PIPE_ITEM_MAX]; cursorObj = new GameObject[PlayerData.PIPE_ITEM_MAX]; itemContainer = new GameObject[PlayerData.PIPE_ITEM_MAX]; gd = GlobalData.Instance; gd.setTileNum(0, true); GameCon.setAtlasSet (GlobalData.baseTileNum); uia = Resources.Load<UIAtlas> (GameCon.basePipeAtlasPath); Vector3 v3pos; for (int i=0; i<PlayerData.PIPE_ITEM_MAX; i++) { item [i] = GameObject.Find ("Item" + i); v3pos = item[i].transform.localPosition; v3pos.x = 30 + 390*i; item[i].transform.localPosition = v3pos; if(i < pd.invenOpenLevel) { setItemValue(i); } else { item [i].SetActive(false); } } // Debug.Log ("pd.invenOpenLevel:"+pd.invenOpenLevel); // for (int i=0; i<pd.invenOpenLevel; i++) { // setItemValue(i); // } totalCostLabel = GameObject.Find ("totalCostLabel"); goldLabel = GameObject.Find ("goldLabel"); }
// Use this for initialization void Awake () { InventoryItemButtonObj = GameObject.Find("InventoryButton"); InventoryItemButtonObj.SetActive(false); ConveyorItemButtonObj = GameObject.Find("conveyorButton"); Pan_inventoryScrollView = GameObject.Find ("Panel_inventoryScrollView"); go_FillRect_Screen = GameObject.Find("FillRect_Screen"); go_FillRect_Screen.SetActive(false); float resolWidth = Screen.width; // Debug.Log("resolWidth: "+resolWidth); float resolHeight = Screen.height; // Debug.Log("resolHeight: "+resolHeight); float ratio1 = resolWidth/resolHeight; // Debug.Log("ratio1: "+ratio1); float gameWidth = 800 * ratio1; // Debug.Log("gameWidth: "+gameWidth); float ratio = gameWidth/1280; float tmpWidth = (gameWidth - 372*ratio); Vector4 range = new Vector4(0, 0, tmpWidth, 160); //Pan_inventoryScrollView.GetComponent<UIPanel>().clipping = UIDrawCall.Clipping.SoftClip; Pan_inventoryScrollView.GetComponent<UIPanel>().baseClipRegion = range; //Pan_inventoryScrollView.GetComponent<UIPanel>().drawCallClipRange = new Vector4(0, 0, Screen.width - 360, 160); gd = GlobalData.Instance; // GameObject.Find("Prefab_Pipe").GetComponent<PipeScript>().setID(170); // GameObject.Find("Prefab_Pipe1").GetComponent<PipeScript>().setID(171); // GameObject.Find("Prefab_Pipe2").GetComponent<PipeScript>().setID(172); // GameObject.Find("Prefab_Pipe3").GetComponent<PipeScript>().setID(173); // GameObject.Find("Prefab_Pipe4").GetComponent<PipeScript>().setID(64); // GameObject.Find("Prefab_Pipe5").GetComponent<PipeScript>().setID(65); // Instance = this; efm = EffectSoundManagerScript.Instance; pd = PlayerData.Instance; gd.setTileNum(0, true); go_Popup_Help = GameObject.Find("Popup_Help"); helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>(); ts = TextScript.Instance; uiSlider_Loading = GameObject.Find ("loading_Slider").GetComponent<UISlider> (); uiSlider_Loading.value = 0; bJustOneTimeCoroutine = false; go_fade = GameObject.Find("Anchor_Center_Fade"); bLoading = true; loading_state = 0; }