示例#1
0
    /// <summary>슬롯에 유닛 정보를 띄움</summary>
    public void InitializeSlotObject()
    {
        string statusText;

        switch (kindOfUnit)
        {
        case GameManager.Job.crook:
            GameManager.Crook currentCrook = GameManager.instance.attatchedCrooks[slotIndex];
            statusText = "Lv " + currentCrook.level;

            /*switch(currentCrook.type)
             * {
             *  case 0: statusText += " 상수형"; break;
             *  case 1: statusText += " 계수형"; break;
             *  case 2: statusText += " 밸런스형"; break;
             *  case 3: statusText += " 호구형"; break;
             * }*/
            statusText += " " + currentCrook.GetType();
            item.transform.Find("CrookImage").GetComponent <Image>().sprite = currentCrook.GetIcon();
            statusText += " 사기꾼";
            item.transform.Find("Status").GetComponent <Text>().text = statusText;

            item.transform.Find("ItemSlot").GetComponent <ItemSlot>().unitIndex = slotIndex;

            item.transform.Find("MoneyStealText").GetComponent <Text>().text       = currentCrook.GetRichConstantDown() + " + " + currentCrook.GetRichRatioDown() + "%";
            item.transform.Find("ReturnPercentageText").GetComponent <Text>().text = currentCrook.GetMoneyUp() + "%";

            item.transform.Find("RetireButton").GetComponent <RetireButton>().InitializeRetireButton(kindOfUnit, slotIndex);
            break;

        case GameManager.Job.snake:
            GameManager.Snake currentSnake = GameManager.instance.attatchedSnakes[slotIndex];
            statusText = "Lv " + currentSnake.level + " " + currentSnake.GetType() + " 꽃뱀";
            item.transform.Find("SnakeImage").GetComponent <Image>().sprite = currentSnake.GetIcon();
            item.transform.Find("Status").GetComponent <Text>().text        = statusText;

            item.transform.Find("ItemSlot").GetComponent <ItemSlot>().unitIndex = slotIndex;

            switch (currentSnake.type)
            {
            case 0: item.transform.Find("Attribute").GetComponent <Text>().text = "절박함 " + currentSnake.GetDesperateControl() + "% 감소"; break;

            case 1: item.transform.Find("Attribute").GetComponent <Text>().text = "일정확률로 " + currentSnake.GetLowerBound() + " 만원~" + currentSnake.GetUpperBound() + " 만원 획득"; break;

            case 2: item.transform.Find("Attribute").GetComponent <Text>().text = currentSnake.GetBehaviorCostIncrease() + " 억원 비용 증가"; break;

            case 3: item.transform.Find("Attribute").GetComponent <Text>().text = currentSnake.RichCycleIncrease() + " 주기 증가"; break;
            }
            item.transform.Find("RetireButton").GetComponent <RetireButton>().InitializeRetireButton(kindOfUnit, slotIndex);
            break;

        case GameManager.Job.gang:
            UnitsManager.instance.ShowAttachedGangs();
            break;
        }
    }
 public void setSnakeUnitInformation(int index, GameManager.Snake snake)
 {
     job        = GameManager.Job.snake;
     this.snake = snake;
     this.index = index;
     transform.Find("Level").GetComponent <Text>().text        = snake.level.ToString();
     transform.Find("Price").GetComponent <Text>().text        = ((int)snake.unitPrice()).ToString() + "만원";
     transform.Find("Type").GetComponent <Text>().text         = snake.GetType();
     transform.Find("Character").GetComponent <Image>().sprite = snake.GetSprite();
 }
示例#3
0
    public void SetUnitInformation(int index, GameManager.Snake snake)
    {
        this.index = index;

        job  = 1;
        type = snake.type;
        string statusText = "Lv " + snake.level;
        Sprite sprite     = null;
        Image  icon       = transform.Find("Icon").GetComponent <Image>();

        /*switch (snake.type)
         * {
         *  case 0: statusText += " 둔감형"; break;
         *  case 1: statusText += " 갈취형"; break;
         *  case 2: statusText += " 낭비형"; break;
         *  case 3: statusText += " 둔화형"; break;
         *
         * }*/
        statusText += (" " + snake.GetType());
        sprite      = snake.GetIcon();
        statusText += " 꽃뱀";
        transform.Find("Status").GetComponent <Text>().text = statusText;

        string attributeText = "";

        switch (snake.type)
        {
        case 0: attributeText += "부자의 절박함 증가량 " + snake.GetDesperateControl() + "% 만큼 감소"; break;

        case 1: attributeText += snake.GetLowerBound() + "만원 ~ " + snake.GetUpperBound() + "만원의 환금형 아이템 획득"; break;

        case 2: attributeText += "부자의 행동 비용 " + snake.GetBehaviorCostIncrease() + "억 원 증가"; break;

        case 3: attributeText += "부자의 행동 주기 " + snake.RichCycleIncrease() + "턴 증가"; break;
        }

        transform.Find("Attribute").GetComponent <Text>().text = attributeText;
        if (sprite != null)
        {
            icon.sprite = sprite;
        }
    }