示例#1
0
        public bool CommitTimeAction(int timeCost)
        {
            if (currentTimeUnits >= timeCost)
            {
                currentTimeUnits -= timeCost;
                timeLabel.SetDynamicText(currentTimeUnits);
                return(true);
            }

            return(false);
        }
示例#2
0
    public bool ObtainItem()
    {
        // 아직 획득되지 않은 경우
        if (bOptained == false)
        {
            bOptained = true;

            // 블록 지역 변수
            GameObject textUI = Instantiate(Resources.Load("UI/DynamicText") as Object, this.gameObject.transform) as GameObject;
            Color      color  = new Color(1.0f, 1.0f, 1.0f, 1.0f);

            // 자원 증가
            if (enType == ItemType.ITEM_GOLD)
            {
                GameManager.SetGold(GameManager.GetGold(true) + iAmount, true);
                color = new Color(1.0f, 1.0f, 0.0f, 1.0f);
            }
            else if (enType == ItemType.ITEM_RUNE)
            {
                GameManager.SetRune(GameManager.GetRune(true) + iAmount, true);
                color = new Color(0.0f, 1.0f, 1.0f, 1.0f);
            }
            else if (enType == ItemType.ITEM_NOTE)
            {
                int iStageNum = GameObject.Find("Stage").GetComponent <Stage>().iStageNumber;
                GameManager.stageInfo[iStageNum - 1].bGotNote = true;
                PlayerPrefs.SetInt("Stage" + iStageNum.ToString() + "Note", 1);
                color = Color.white;
            }

            // 유동 텍스트 생성 및 위치와 색상 적용
            if (enType != ItemType.ITEM_NOTE)
            {
                DynamicText dynamicText = textUI.GetComponent <DynamicText>();
                dynamicText.SetDynamicText(("+" + iAmount), 30, 2.00f, this.gameObject.transform.position, color, new Vector3(0.0f, 1.0f, 0.0f), new Color(0.0f, 0.0f, 0.0f, -0.5f));
            }
            else
            {
                DynamicText dynamicText = textUI.GetComponent <DynamicText>();
                dynamicText.SetDynamicText("일지 획득!", 30, 2.00f, this.gameObject.transform.position, color, new Vector3(0.0f, 1.0f, 0.0f), new Color(0.0f, 0.0f, 0.0f, -0.5f));
            }

            return(true);
        }
        // 이미 획득된 경우
        else
        {
            return(false);
        }
    }
示例#3
0
        public void Show(IEnumerable <Transform> path)
        {
            gameObject.SetActive(true);
            if (path == null)
            {
                return;
            }

            transform.position = path.Last().position;

            if (MovementCost != null)
            {
                MovementCost.SetDynamicText(path.Count() - 1);
            }
        }
示例#4
0
 public void UpdateAimAction(int timeUnits)
 {
     AimAction.SetDynamicText(timeUnits);
 }
示例#5
0
 public void UpdateFireAction(string modeName, int timeUnits)
 {
     FireAction.SetDynamicText(modeName, timeUnits);
 }
示例#6
0
 public void UpdateReload(int timeUnits)
 {
     ReloadAction.SetDynamicText(timeUnits);
 }
示例#7
0
 public void UpdateAmmo(int remaining, int total)
 {
     Ammo.SetDynamicText(remaining, total);
 }
示例#8
0
 public void UpdateTimeUnits(int remaining, int total)
 {
     TimeUnits.SetDynamicText(remaining, total);
 }