示例#1
0
 public void addLifePack(LifePack lp)
 {
     pendingLP = lp;
 }
示例#2
0
    public void processLifePack()
    {
        if (pendingLP == null)
        {
            return;
        }

        LifePack lp = pendingLP;
        pendingLP = null;

        UnityEngine.Object o = Instantiate(lifePackPrefab, new Vector3(lp.Pos.X * 2f, 0.5f, lp.Pos.Y * 2f), Quaternion.identity);

        GameObject go = (GameObject)o;
        LifePackPerfab lifePackPerf = go.GetComponent<LifePackPerfab>();
        lifePackPerf.lifetime = lp.Seconds;
        lifePackPerf.position = lp.Pos;

        Destroy(go, lp.Seconds / 1000.0f);
        lpMap.Add(lp.Pos, go);
    }
示例#3
0
 void removeTakenLP(Point playerPos)
 {
     LifePack[] tempList = new LifePack[navigator.gameInstance.getLifePacks().Count];
     navigator.gameInstance.getLifePacks().CopyTo(tempList);
     foreach (LifePack c in tempList)
     {
         if (playerPos == c.Pos)
         {
             Destroy(lpMap[playerPos]);
             navigator.gameInstance.removeLifePack(playerPos);
             lpMap.Remove(playerPos);
         }
     }
 }
示例#4
0
 public void addLifePack(Point loc, int sec)
 {
     LifePack lp = new LifePack(loc, sec);
     lifePacks.Add(lp);
     navigator.map.addLifePack(lp);
 }