作りました (tsukurimashita - created) かわりました (kawarimashita - changed) はヌルじゃない (variable wa naru janai - not null) の終わり (method no owari - method's end)
Наследование: MonoBehaviour
Пример #1
0
    private void Awake()
    {
        carUIController  = GameObject.FindGameObjectWithTag("CarUI").GetComponent <CarUIController>();
        mainUIController = GameObject.FindGameObjectWithTag("MainUI").GetComponent <MainUIController>();

        StopGameFirst();
    }
Пример #2
0
 // Use this for initialization
 void Awake()
 {
     player           = GameObject.Find("Player").GetComponent <PlayerController>();
     cameraController = GameObject.Find("Main Camera").GetComponent <CameraController>();
     GetComponent <SoundController>();
     mainUI = GameObject.Find("MainUI").GetComponent <MainUIController>();
 }
Пример #3
0
 // Use this for initialization
 void Awake()
 {
     rb           = GetComponent <Rigidbody>();
     soundControl = GameObject.FindGameObjectWithTag("SoundController").GetComponent <SoundController>();
     control      = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
     UIcontrol    = GameObject.FindGameObjectWithTag("UI").GetComponent <MainUIController>();
 }
Пример #4
0
    // Start is called before the first frame update

    void Awake()
    {
        _DataManager = GetComponent <DataManager>();
        _DataManager.Init();

        countrySelectedList = new List <Country_SO>();

        _MarkControllers = m_Maps.GetComponentsInChildren <MarkController>();

        foreach (var item in _MarkControllers)
        {
            item.Init(this);
            item.OnCountryShow += ShowCountyInfo;
        }

        _CountryInfo = m_Canvas.GetComponentInChildren <CountryInfoUIController>(true);
        _CountryInfo.Init(this);

        _MainUIController = m_Canvas.GetComponentInChildren <MainUIController>(true);
        _MainUIController.Init(this);

        _SelectCountryUIController = m_Canvas.GetComponentInChildren <SelectCountryUIController>(true);
        _SelectCountryUIController.Init(this);

        UpdateUI();
    }
Пример #5
0
 //変わります 7月13日 7月13日 2015
 public void resetToIntro()
 {
     ctr = nullityChecker();
     if (ctr) {
         ctr.resetIntro();
     }
 }
Пример #6
0
 private void Awake()
 {
     Time.timeScale = 1;
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #7
0
    // A class to keep static references for all major game elements, to easily facilitate referencing between classes

    void Awake()
    {
        gameController   = GetComponent <GameController>();
        playerScreen     = GameObject.Find("PlayerScreen").GetComponent <PlayerScreenController>();
        lungCharacter    = GameObject.Find("LungCharacter").GetComponent <LungCharacterController>();
        mainUIController = GameObject.Find("MainUI").GetComponent <MainUIController>();
        SetEnemiesAccordingToTriggers();
    }
Пример #8
0
    // Use this for initialization


    void Awake()
    {
        rb = GetComponent <Rigidbody>();
        currentFirerate = 0;
        boltSize        = 1;
        soundControl    = GameObject.FindGameObjectWithTag("SoundController").GetComponent <SoundController>();
        control         = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        uicontrol       = GameObject.FindGameObjectWithTag("UI").GetComponent <MainUIController>();
    }
Пример #9
0
 private void Awake()
 {
     // PlayerPrefs.DeleteAll();
     instance = this;
     CheckMute();
     GameAnalytics.Initialize();
     Facebook.Unity.FB.Init();
     CheckCompletedChallenges();
 }
Пример #10
0
    void Awake()
    {
        instance = this;

        pauseBtn.onClick.AddListener(new UnityAction(Pause));
        homeBtn.onClick.AddListener(new UnityAction(Home));

        // 出现暂停后,返回主菜单的时候,再进入蛇无法运动的情况
        Time.timeScale = 1;
    }
Пример #11
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Пример #12
0
 public void switchHUDToResult()
 {
     ctr = nullityChecker();
     if (ctr)
     {
         ctr.showResult = true;
         ctr.showHUD = false;
         ctr.switchMouse(true);
         ctr.showfader = false;
     }//end of if
 }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        _instance = this;           //设置GameManager Instance引用
        mainUICtr = MainUI.GetComponent <MainUIController>();

        StartUI.SetActive(true); //显示开始UI
        MainUI.SetActive(false); //隐藏游戏主UI
        EndUI.SetActive(false);  //隐藏结束UI

        initTip();               //初始化提示图片
        initGame();              //初始化主游戏逻辑
    }
Пример #14
0
    // Use this for initialization
    void Start()
    {
        if (instance != null)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;

        DontDestroyOnLoad(this);
    }
Пример #15
0
 // Use this for initialization
 void Awake()
 {
     rb           = GetComponent <Rigidbody>();
     soundControl = GameObject.FindGameObjectWithTag("SoundController")
                    .GetComponent <SoundController>();
     control = GameObject.FindGameObjectWithTag("GameController")
               .GetComponent <GameController>();
     //BoltP = GameObject.FindGameObjectWithTag("EnemyBoltPool").
     //                                GetComponent<BoltPool>();
     UIControl = GameObject.FindGameObjectWithTag("UI")
                 .GetComponent <MainUIController>();
 }
Пример #16
0
 public void switchToHUDFromRiskAna()
 {
     ctr = nullityChecker();
     if(ctr){
         ctr.showRisk = false;
         ctr.showHUD = true;
         ctr.showfader = true;
         ctr.deathFlag = false;
         ctr.switchControls(true);
         ctr.resetFader();
     }//end of if
 }
Пример #17
0
    public void deathSwitchHUD()
    {
        ctr = nullityChecker();
        if (ctr)
        {
            ctr.deathFlag = true;
            ctr.showRisk = false;
            ctr.showHUD = false;
            ctr.showResult = true;

        }//end of not null
    }
Пример #18
0
        public void InitCategory(string jsondata)
        {
            if (string.IsNullOrEmpty(jsondata))
            {
                Debuger.LogError("the jsondata is null!");
                MainUIController.ShowMainUIMsg(Constant.DATA_LOAD_ERROR);
                return;
            }
            JTab tabClass = UnityEngine.JsonUtility.FromJson <JTab>(jsondata);

            if (tabClass != null && tabClass.data != null && tabClass.result_code == "0")
            {
                JCategoryList list = tabClass.data;
                CategoryList = new JCategoryList();
                // 首页 离线 历史
                CategoryList.categoryList = new JCategoryItem[list.categoryList.Length + 3];

                // 添加首页
                CategoryList.categoryList[0] = createTabCategoryItem(Constant.TAB_MAIN_NAME, "homepage", null, null);
                //CategoryList.categoryList[0].title = Constant.TAB_MAIN_NAME;
                //CategoryList.categoryList[0].category = new JCategory();
                //CategoryList.categoryList[0].category.homePageLeftTopic = Constant.TAB_MAIN_NAME;

                // 添加网络数据
                for (int i = 1; i < list.categoryList.Length + 1; i++)
                {
                    CategoryList.categoryList[i] = list.categoryList[i - 1];
                }

                // 添加离线
                string[] tstr = new string[2];
                tstr[0] = Constant.TAB_DOWNLOAD_NAME;
                tstr[1] = Constant.TAB_LOCAL_NAME;
                string[] tpgStr = new string[2];
                tpgStr[0] = Constant.TAB_PAGECATEGORY_DOWNLOAD;
                tpgStr[1] = Constant.TAB_PAGECATEGORY_LOCAL;
                JCategoryItem tItem = createTabCategoryItem(Constant.TAB_OFFLINE_NAME, Constant.TAB_PAGECATEGORY_LOCAL, tstr, tpgStr);
                CategoryList.categoryList[list.categoryList.Length + 1] = tItem;

                // 添加历史
                string[]      tstr2   = new string[0];
                string[]      tpgStr2 = new string[0];
                JCategoryItem tItem1  = createTabCategoryItem(Constant.TAB_HISTORY_NAME, Constant.TAB_PAGECATEGORY_HISTORY, tstr2, tpgStr2);
                CategoryList.categoryList[list.categoryList.Length + 2] = tItem1;

                MsgManager.Instance.SendMsg(MsgID.UpdataCategoryData);
            }
            else
            {
                MainUIController.ShowMainUIMsg(Constant.DATA_LOAD_ERROR);
            }
        }
 // Use this for initialization
 void Awake()
 {
     player = GameObject.FindGameObjectWithTag("Player").
              GetComponent <PlayerController>();
     UI = GameObject.FindGameObjectWithTag("UI").
          GetComponent <MainUIController>();
     money          = 0;
     playerAtk      = 1;
     killCount      = 0;
     enemyLevel     = 0;
     baseIncome     = 10;
     incomeWeight   = 1.03f;
     supporterCount = 0;
     currentIncome  = baseIncome * Mathf.Pow(incomeWeight, enemyLevel);
 }
Пример #20
0
        private void OnItemGetClickEvent(IEvent ievent)
        {
            var _e         = ievent as Event_ItemInfoClick;
            var _item      = DataModel.GetPathList[_e.Index];
            var _tbItemGet = Table.GetItemGetInfo(_item.ItemGetId);

            if (_tbItemGet.IsShow == -1) //开启条件
            {
                if (_item.ItemGetId == 21)
                {//领地争夺有灭世入口
                    MainUIController MainCtr = UIManager.Instance.GetController(UIConfig.MainUI) as MainUIController;
                    if (1 != (MainCtr.GetDataModel("MainUI") as MainUIDataModel).MainActivity)
                    {
                        GameUtils.ShowHintTip(GameUtils.GetDictionaryText(270229));
                        return;
                    }
                }
                EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.ItemInfoUI));
                EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.ChestInfoUI));
                GameUtils.GotoUiTab(_tbItemGet.UIName, _tbItemGet.Param[0], _tbItemGet.Param[1], _tbItemGet.Param[2]);
            }
            else
            {
                var _dic = PlayerDataManager.Instance.CheckCondition(_tbItemGet.IsShow);
                if (_dic != 0)
                {
                    //不符合副本扫荡条件
                    EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard(_dic));
                    return;
                }
                EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.ItemInfoUI));
                EventDispatcher.Instance.DispatchEvent(new Close_UI_Event(UIConfig.ChestInfoUI));
                //从道具途径进入活动二级界面,关闭时不回活动一级界面,但是如果道具在活动界面时,关闭要显示一级界面
                if (UIManager.Instance.GetController(UIConfig.ActivityUI).State == FrameState.Open)
                {
                    GameUtils.GotoUiTab(_tbItemGet.UIName, _tbItemGet.Param[0], _tbItemGet.Param[1], _tbItemGet.Param[2]);
                }
                else
                {
                    GameUtils.GotoUiTab(_tbItemGet.UIName, _tbItemGet.Param[0], _tbItemGet.Param[1], 0);
                }
            }
            if (UIManager.Instance.GetController(UIConfig.QuickBuyUi).State == FrameState.Open)
            {
                var e = new Close_UI_Event(UIConfig.QuickBuyUi);
                EventDispatcher.Instance.DispatchEvent(e);
            }
        }
Пример #21
0
 // Use this for initialization
 void Start()
 {
     stage      = 1;
     duringBoss = false;
     isGameOver = false;
     hazard     = StartCoroutine(Hazards());
     spawn      = StartCoroutine(Spawn());
     Score      = 0;
     pc         = GameObject.FindGameObjectWithTag("Player").GetComponent <NewBehaviourScript>();
     ui         = GameObject.FindGameObjectWithTag("UI").GetComponent <MainUIController>();
     ui.setScore(Score);
     for (int i = 0; i < BGs.Length; i++)
     {
         BGs[i].StartScroll();
     }
 }
Пример #22
0
 // Use this for initialization
 void Start()
 {
     IsGameOver    = false;
     IsBossAlive   = false;
     player        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     PlayerLife    = DefaultPlayerLife - 1;
     hazardRoutine = StartCoroutine(Hazards());
     for (int i = 0; i < BGs.Length; i++)
     {
         BGs[i].StartScroll();
     }
     Score = 0;
     ui    = GameObject.FindGameObjectWithTag("UI").GetComponent <MainUIController>();
     ui.SetScore(Score);
     ui.SetPlayerLife(PlayerLife);
     currentStageNumber = 1;
 }
    // Use this for initialization
    void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }

        fadeController = new FadeController();

        player = GameObject.FindObjectOfType <Player>();
        islandInteractionUI        = GetComponent <IslandInteractionUI>();
        player.OnInfoUpdatedEvent += UpdateInfamy;
    }
Пример #24
0
        public MainUIController __Gen_Delegate_Imp3()
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;

            PCall(L, 0, 1, errFunc);


            MainUIController __gen_ret = (MainUIController)translator.GetObject(L, errFunc + 1, typeof(MainUIController));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Пример #25
0
    public override void Init()
    {
        instance = this;

        GameObject g = Instantiate <GameObject>((GameObject)Resources.Load("UI/StaticCanvas"), transform);

        staticCanvas = g.GetComponent <StaticCanvasUIController>();
        staticCanvas.Init(uiCamera);
        staticCanvas.Activate();

        g            = Instantiate <GameObject>((GameObject)Resources.Load("UI/CombatStatsCanvas"), transform);
        combatCanvas = g.GetComponent <CombatStatsUIController>();
        combatCanvas.Init(uiCamera);
        combatCanvas.Deactivate();

        g          = Instantiate <GameObject>((GameObject)Resources.Load("UI/HandCanvas"), transform);
        handCanvas = g.GetComponent <HandCanvasUIController>();
        handCanvas.Init(uiCamera);
        handCanvas.Deactivate();

        g           = Instantiate <GameObject>((GameObject)Resources.Load("UI/InputCanvas"), transform);
        inputCanvas = g.GetComponent <InputUIController>();
        inputCanvas.Init(uiCamera);
        inputCanvas.Activate();


        g = Instantiate <GameObject>((GameObject)Resources.Load("UI/TimelineCanvas"), transform);
        timelineCanvas = g.GetComponent <TimelineUIController>();
        timelineCanvas.Init(uiCamera);
        timelineCanvas.Activate();

        g           = Instantiate <GameObject>((GameObject)Resources.Load("UI/EnemyCanvas"), transform);
        enemyCanvas = g.GetComponent <EnemyCanvasUIController>();
        enemyCanvas.Init(uiCamera);
        enemyCanvas.Deactivate();
    }
Пример #26
0
    // Update is called once per frame
    void Update()
    {
        if(Input.GetKeyDown(KeyCode.R)){
            if(mainUIController!=null){
                 ctr = mainUIController.GetComponent<MainUIController>();
                ctr.showRisk = !ctr.showRisk;
                ctr.showHUD = !ctr.showHUD;
            }
        }//risk ui pops

        if(Input.GetKeyDown(KeyCode.Escape)){
            if(mainUIController!=null){
                ctr = mainUIController.GetComponent<MainUIController>();
                if(ctr.showRisk){
                    if(riskAnalysis!=null){
                        RiskAnalysisChecker checker = riskAnalysis.GetComponent<RiskAnalysisChecker>();
                        if(checker!=null){
                            checker.submitAnalysis();
                        }//end of if
                    }//end of risk
                }
            }//end of if
        }//end of if special case of risk analysis
    }
Пример #27
0
 void Awake()
 {
     _instance      = this;
     Time.timeScale = 1;
 }
Пример #28
0
 private void Awake()
 {
     _mainUiController = GetComponentInParent <MainUIController>();
 }
Пример #29
0
 void Awake()
 {
     _instance = this;
 }
Пример #30
0
 private void Awake()
 {
     _instance = this;
 }
Пример #31
0
 void Awake()
 {
     Instance = this;
 }