예제 #1
0
 void Update()
 {
     if (XPMaster.s != null)
     {
         if (XPMaster.s.level.Count > XPMaster.SideToInt(mySide))
         {
             level       = XPMaster.s.level [XPMaster.SideToInt(mySide)];
             txtLvl.text = (level + 1).ToString();
             xp_percent  = XPMaster.s.xp_percent [XPMaster.SideToInt(mySide)];
             sldXp.value = xp_percent;
         }
     }
 }
예제 #2
0
파일: XPMaster.cs 프로젝트: atahan-git/DotT
    void Start()
    {
        s = this;

        print("Setting up XPMaster values");

        if (level.Count == 0)
        {
            SetUp();
        }

        for (int i = 0; i < 3; i++)
        {
            reqXp [i] = ReqLevelCalculator(level[i]);
        }
    }
예제 #3
0
    IEnumerator SetUpSide()
    {
        yield return(null);

        while (PlayerSpawner.LocalPlayerSpawner == null)
        {
            yield return(null);
        }
        while (PlayerSpawner.LocalPlayerSpawner.myHealth == null)
        {
            yield return(null);
        }

        switch (visualId)
        {
        case 0:
            mySide = PlayerSpawner.LocalPlayerSpawner.mySide;
            break;

        case 1:
            if (PlayerSpawner.LocalPlayerSpawner.mySide == Health.Side.blue)
            {
                mySide = Health.Side.red;
            }
            else
            {
                mySide = Health.Side.blue;
            }
            break;

        case 2:
            if (PlayerSpawner.LocalPlayerSpawner.mySide == Health.Side.blue)
            {
                mySide = Health.Side.green;
            }
            else if (PlayerSpawner.LocalPlayerSpawner.mySide == Health.Side.red)
            {
                mySide = Health.Side.green;
            }
            else
            {
                mySide = Health.Side.red;
            }
            break;

        default:
            Debug.LogError("XPandHeroVisualsDisplay VisualId not set");
            break;
        }

        SetColor();


        HeroTopBarDisplay[] myDisps = GetComponentsInChildren <HeroTopBarDisplay> ();

        for (int i = 0; i < 3; i++)
        {
            myDisps [i].myPlayerId = (XPMaster.SideToInt(mySide) * 3) + (2 - i);
            myDisps [i].SetUp();
            //print (myDisps [i].gameObject.name);
        }
    }