Beispiel #1
0
 private void UpdateUnitFrameInfo(object obj)
 {
     for (int i = 0; i < sceneAssetsManager.playerList.Count; i++)
     {
         Player        player        = sceneAssetsManager.playerList[i];
         UnitFrameView unitFrameView = sceneAssetsManager.unitFrameViewMap[player.myInfo.id];
         unitFrameView.AddFrameInfo(player.unitFrameInfo);
     }
 }
Beispiel #2
0
 void Update()
 {
     if (isRunning)
     {
         for (int i = 0; i < sceneAssetsManager.unitFrameViewList.Count; i++)
         {
             UnitFrameView unitFrameView = sceneAssetsManager.unitFrameViewList[i];
             unitFrameView.DoUpdate();
         }
     }
 }
Beispiel #3
0
 public void OnDestroy()
 {
     for (int i = 0; i < playerList.Count; i++)
     {
         Player player = playerList[i];
         player.Destroy();
     }
     for (int i = 0; i < unitFrameViewList.Count; i++)
     {
         UnitFrameView unitFrameView = unitFrameViewList[i];
         unitFrameView.Destroy();
     }
     unitFrameViewMap.Clear();
     unitFrameViewList = null;
     unitFrameViewMap  = null;
     playerList        = null;
 }
Beispiel #4
0
    private void AddPlayer()
    {
        Debug.Log("AddPlayer...");
        Player       player = new Player();
        BaseUnitInfo info   = new BaseUnitInfo();

        //TODO copy data from server and config
        player.Init(info);

        GameObject    unitFrameShell = GameObject.CreatePrimitive(PrimitiveType.Cube);
        UnitFrameView unitFrameView  = unitFrameShell.AddComponent <UnitFrameView>();

        unitFrameView.myInfo = info;

        playerList.Add(player);
        unitFrameViewList.Add(unitFrameView);
        unitFrameViewMap.Add(info.id, unitFrameView);
    }
Beispiel #5
0
    public void FireUnitFrameInfo(UnitFrameInfo unitInfo)
    {
        UnitFrameView unitFrameView = sceneAssetsManager.unitFrameViewMap[unitInfo.id];

        unitFrameView.AddFrameInfo(unitInfo);
    }