public void SetCurrentCase(int caseNumber)
        {
            if (caseNumber != CurrentCase)
            {
                // currentCaseButtonUnpressed
                CaseButtons[CurrentCase].GetComponent <CaseButton>().SetButtonDefault();

                CurrentCase = Mathf.Clamp(caseNumber, 0, numberOfCases);

                CaseFlash.Instance.HideFlash();
                if (numberOfCases > 1)
                {
                    CaseFlash.Instance.ShowNewCaseFlash(CurrentCase);
                }
            }

            // currentCaseButtonPressed
            CaseButtons[CurrentCase].GetComponent <CaseButton>().SetButtonActive();

            // Call every implemented event
            foreach (var ev in UISingleton.FindInterfaces <IPMCaseSwitched>())
            {
                ev.OnPMCaseSwitched(CurrentCase);
            }
        }
        private IEnumerator ShowAnswerBubble(int lineNumber, string answer, bool correct)
        {
            compilerHasBeenStopped = false;

            UISingleton.instance.answerBubble.ShowMessage(lineNumber);
            UISingleton.instance.answerBubble.SetAnswerMessage("Svar: " + answer);

            yield return(new WaitForSeconds(3 * (1 - PMWrapper.speedMultiplier)));

            if (compilerHasBeenStopped)
            {
                AbortCase();
                yield break;
            }

            if (correct)
            {
                // Call every implemented event
                foreach (var ev in UISingleton.FindInterfaces <IPMCorrectAnswer>())
                {
                    ev.OnPMCorrectAnswer(answer);
                }
            }
            else
            {
                UISingleton.instance.levelHandler.currentLevel.caseHandler.CaseFailed();

                // Call every implemented event
                foreach (var ev in UISingleton.FindInterfaces <IPMWrongAnswer>())
                {
                    ev.OnPMWrongAnswer(answer);
                }
            }
        }
예제 #3
0
    void Start()
    {
        uISingleton = UISingleton.Instance;
        // Find All UI Objects
        levelPanel = uISingleton.GetComponentInChildren <LevelPanel>();

        UpdateUI();
    }
예제 #4
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
     IntializeUI();
 }
예제 #5
0
    void Awake()
    {
        if (Get_Instance())
        {
            DestroyImmediate(this.gameObject);
            return;
        }

        uiinstance = this;
    }
예제 #6
0
 void Start()
 {
     uISingleton         = UISingleton.Instance;
     sanityUI            = uISingleton.GetComponentInChildren <SanityUI>();
     maxEssence          = 5;
     activeSoul          = Soul.gravity;
     inactiveSoul        = Soul.poison;
     this.gravityEssence = this.maxEssence;
     this.poisonEssence  = this.maxEssence;
 }
예제 #7
0
    private void Awake()
    {
        // if the singleton hasn't been initialized yet
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);
        gameOverLabel.enabled = false;
    }
예제 #8
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #9
0
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     //initial setup;
     DontDestroyOnLoad(gameObject);
 }
예제 #10
0
    void Start()
    {
        player      = PlayerSingleton.Instance.player;
        playerRelic = player.relics;
        relics      = playerRelic.relics;
        SetStartingItems();

        uISingleton = UISingleton.Instance;
        itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>();

        this.OnPointerEnterEvent += ShowTooltip;
        this.OnPointerExitEvent  += HideTooltip;
    }
        public void LoadLevel(int level)
        {
            PMWrapper.StopCompiler();

            // TODO Save mainCode to database
            UISingleton.instance.saveData.ClearPreAndMainCode();
            currentLevel.levelSetting.UseSettings();

            // Call every implemented event
            foreach (var ev in UISingleton.FindInterfaces <IPMLevelChanged>())
            {
                ev.OnPMLevelChanged();
            }
        }
예제 #12
0
파일: Player.cs 프로젝트: bbroeking/artemis
    protected override void Start()
    {
        // Find All UI Objects
        uISingleton = UISingleton.Instance;
        soulPanel   = uISingleton.GetComponentInChildren <SoulPanel>();
        recapUI     = uISingleton.GetComponentInChildren <RecapUI>();
        relicUI     = uISingleton.GetComponentInChildren <RelicUI>();
        itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>();
        // itemSaveManager = FindObjectOfType<ItemSaveManager>(); TODO: Save System

        // Set UI
        soulPanel.SetTexts(this.souls);
        soulPanel.UpdateTextsValues();

        // TODO setting base values here is going to cause confusion
        map = new Room(new Vector2(0, 0), true, true, true, true); // default path
    }
    void Start()
    {
        MGR = new ManagerSingleton();
        UI  = new UISingleton();

        List <Dictionary <string, object> > data = CSVReaderScript.Read("potion_table");

        if (itemblock_parents)
        {
            for (var i = 0; i < data.Count; i++)
            {
                if (data[i]["Name"] != null)
                {
                    input_temp = Instantiate(itemblock_prefeb, itemblock_parents.transform);
                    input_temp.transform.GetChild(1).GetComponent <Text>().text =
                        data[i]["Name"].ToString() + "\n 가치 :" + data[i]["Value"].ToString();
                    input_temp.transform.GetChild(2).GetComponent <Text>().text =
                        "종류: " + data[i]["Kind"].ToString() + "\n" + "회복량: " + data[i]["Increase"].ToString();

                    if (data[i]["Kind"].ToString() == "HP")
                    {
                        input_temp.transform.GetChild(0).GetComponent <Image>().sprite = HPIMAGE;
                        kind     = 3;
                        value    = int.Parse(data[i]["Value"].ToString());
                        increase = float.Parse(data[i]["Increase"].ToString());
                        desc     = data[i]["Description"].ToString();
                        Item temp = new Item(HPIMAGE, true, kind, "HP포션", value, increase, 0, 0, 1, desc);
                        ItemList.Add(temp);
                    }
                    else if (data[i]["Kind"].ToString() == "MP")
                    {
                        input_temp.transform.GetChild(0).GetComponent <Image>().sprite = MPIMAGE;
                        kind     = 4;
                        value    = int.Parse(data[i]["Value"].ToString());
                        increase = float.Parse(data[i]["Increase"].ToString());
                        desc     = data[i]["Description"].ToString();
                        Item temp = new Item(HPIMAGE, true, kind, "MP포션", value, increase, 0, 0, 1, desc);
                        ItemList.Add(temp);
                    }
                }
            }
        }
    }
예제 #14
0
    // Start is called before the first frame update
    void Start()
    {
        MGR = new ManagerSingleton();
        FC  = new FollowCamera();
        UI  = new UISingleton();
        bb  = UI.Get_Instance().transform.GetChild(3).gameObject;
        ReturnOldScene    d_s = new GameManagerScript().Get_OldScene;
        ReturnOldPosition d_p = new PlayerManagerScripts().Get_OldPosition;



        if (d_s() != null)
        {
            if (d_s() != null)
            {
                if (d_s() != SceneManager.GetActiveScene().ToString() || d_s() != null)
                {
                    this.transform.position = d_p();
                }
            }
        }

        Vector3 angles = this.transform.eulerAngles;

        Rotate = this.transform.forward.x;
        Anim   = this.GetComponent <Animator>();

        if (Target_Frame != null)
        {
            Target_Frame.SetActive(false);
        }

        MoveFlag = false;

        if (this.gameObject.transform.name == "Pirate") // 나중에 다른 캐릭터 추가되면 리소스로드로 Sprite 바꾸는거 추가... 19.08.15
        {
        }
    }
예제 #15
0
 void Start()
 {
     uISingleton = UISingleton.Instance;
     uISingleton.setHealth(health);
 }
예제 #16
0
 // Start is called before the first frame update
 void Start()
 {
     uISingleton = UISingleton.Instance;
     uISingleton.setBullets(bulletsInMagazine.ToString());
     uISingleton.setMagazines(magazines.ToString());
 }
예제 #17
0
	void Awake()
	{
		mUIInstance = this;	
	}