예제 #1
0
 public void OnStatsChanged(Bolt.IState myState, string path, Bolt.ArrayIndices indices)
 {
     if (state.items[indices[0]].ID == 0)
     {
         myInventory.clearItem(indices[0]);
     }
     else
     {
         myInventory.refreshItem(indices[0]);
     }
     // Debug.Log(indices[0]);
     // int index = indices[0];
 }
예제 #2
0
    public void OnStatsChanged(IWorldState state, string path, Bolt.ArrayIndices indices)
    {
        int index = indices[0];

        int damage = state.Cubes[index];

        if (damage > 5)
        {
            CubeRoot.GetChild(index).gameObject.SetActive(false);
        }
        else
        {
            CubeRoot.GetChild(index).GetComponent <MeshRenderer>().material.color = new Color(1 - (damage / 5f), 1 - (damage / 5f), 1 - (damage / 5f), 1);
        }
    }