Exemplo n.º 1
0
 public void RemoveSmallToken(SmallToken smallToken)
 {
     if (smallTokens.Contains(convertToKey(smallToken.GetComponent <PhotonView>().ViewID)))
     {
         int viewID = smallToken.GetComponent <PhotonView>().ViewID;
         GameManager.instance.photonView.RPC("RemoveSmallTokenRPC", RpcTarget.AllViaServer, new object[] { viewID, parentHero });
     }
     else
     {
         Debug.Log("Error hero inventory remove smallToken");
     }
 }
Exemplo n.º 2
0
    public void ReplaceSmallToken(SmallToken original, SmallToken newItem, bool destroy = false)
    {
        int originalViewID = original.GetComponent <PhotonView>().ViewID;
        int newViewID      = newItem.GetComponent <PhotonView>().ViewID;

        if (smallTokens.Contains(convertToKey(originalViewID)))
        {
            GameManager.instance.photonView.RPC("ReplaceSmallTokenRPC", RpcTarget.AllViaServer, new object[] { originalViewID, newViewID, destroy, parentHero });
        }
        else
        {
            Debug.Log("Error hero inventory remove BigToken");
        }
    }
Exemplo n.º 3
0
 //what to do with errors
 public bool AddSmallToken(SmallToken smallToken)
 {
     if (smallTokens.Count >= spaceSmall)
     {
         EventManager.TriggerError(1);
         return(false);
     }
     else
     {
         int viewID = smallToken.GetComponent <PhotonView>().ViewID;
         GameManager.instance.photonView.RPC("AddSmallTokenRPC", RpcTarget.AllViaServer, new object[] { viewID, parentHero });
         return(true);
     }
 }
Exemplo n.º 4
0
    public void AddSmallToken2(SmallToken smallToken)
    {
        string id = convertToKey(smallToken.GetComponent <PhotonView>().ViewID);

        smallTokens.Add(id, (SmallToken)smallToken);
        AllTokens.Add(id, (SmallToken)smallToken);

        if (GameManager.instance.MainHero.TokenName.Equals(parentHero))
        {
            EventManager.TriggerInventoryUIHeroUpdate(this);
        }
        else if (parentHero.Equals(CharChoice.choice.TokenName))
        {
            EventManager.TriggerInventoryUIHeroPeak(this);
        }
    }