コード例 #1
0
    private void AddPlayerRender(PlayerStat playerStat)
    {
        PlayerStatUI prefab;

        switch (playerStat.Rel)
        {
        case RelType.Self:
            prefab = selfPlayerStatPrefab;
            break;

        case RelType.Friend:
            prefab = friendPlayerStatPrefab;
            break;

        case RelType.NextRank:
            prefab = nextrankPlayerStatPrefab;
            break;

        default:
            prefab = playerStatPrefab;
            break;
        }
        PlayerStatUI playerStatUI = Instantiate(prefab, globalBroad);

        playerStatUI.Set(playerStat);
    }
コード例 #2
0
 private void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.LogError("Duplicate " + this.GetType().Name);
         Destroy(gameObject);
     }
     gameObject.SetActive(false);
 }