示例#1
0
文件: HexCell.cs 项目: mmielus/Stars
    public void Discover(Ownable owned)
    {
        visibleByList.Add(owned);
        discoveredBy.Add(owned.GetOwner());

        State = EHexState.Visible;
        if (!IsEmpty())
        {
            ObjectInCell.SetActive(true);
        }
        gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial;
    }
示例#2
0
文件: HexCell.cs 项目: mmielus/Stars
    public void UnDiscover()
    {
        visibleByList.Clear();
        State = EHexState.Undiscovered;

        if (!IsEmpty() && ObjectInCell.tag != "Star")
        {
            ObjectInCell.SetActive(false);
        }

        gameObject.GetComponentInChildren <MeshRenderer>().material = UndiscoveredMaterial;
        if (!IsEmpty() && ObjectInCell.tag == "Star")
        {
            gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial;
        }
    }
示例#3
0
文件: HexCell.cs 项目: mmielus/Stars
    public void Hide()
    {
        visibleByList.Clear();
        State = EHexState.Hidden;
        gameObject.GetComponentInChildren <MeshRenderer>().material = HiddenMaterial;

        if (!IsEmpty())
        {
            if (ObjectInCell.tag != "Star" && ObjectInCell.tag != "Planet")
            {
                ObjectInCell.SetActive(false);
            }
            if (ObjectInCell.tag == "Star")
            {
                gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial;
            }
        }
    }