Exemplo n.º 1
0
    /*##################################
    # EVENTS
    ##################################*/

    /*****************
     * Interact With Octopus
     ******************/
    public void InteractWithOctopusStart(GameObject octopus)
    {
        thisOctopus = octopus;
        if (Shell > 0)
        {
            CantInteractPanel.Panel.transform.Find("feed_with_haixing").gameObject.GetComponent <Button>().interactable = true;
        }
        else
        {
            CantInteractPanel.Panel.transform.Find("feed_with_haixing").gameObject.GetComponent <Button>().interactable = false;
        }
        CantInteractPanel.Toogle();
    }
Exemplo n.º 2
0
    /*****************
     * Interact with island
     ******************/
    public void InteractWithIslandStart(GameObject iPoint)
    {
        InteractionPoint = iPoint;
        //Check Camouflage Type
        foreach (Transform child in ChangeCamouflagePanel.Panel.transform)
        {
            if (child.gameObject.name == "Text" || child.gameObject.name == "Cancel")
            {
                continue;
            }
            child.gameObject.GetComponent <Button>().interactable = false;
        }
        //IWIEventPanel.Panel.transform.Find("camouflage").gameObject.GetComponent<Button>().interactable = false;
        List <IslandType> currentIslandType = InteractionPoint.transform.parent.gameObject.GetComponent <IslandConfig>().IslandTypeList;

        foreach (IslandType type in currentIslandType)
        {
            switch (type)
            {
            case IslandType.Banyan: {
                if (ShipController.camouflageType != IslandType.Banyan)
                {
                    ChangeCamouflagePanel.Panel.transform.Find("Banyan").gameObject.GetComponent <Button>().interactable = true;
                }
                break;
            }

            case IslandType.Cinchona: {
                if (ShipController.camouflageType != IslandType.Cinchona)
                {
                    ChangeCamouflagePanel.Panel.transform.Find("Cinchona").gameObject.GetComponent <Button>().interactable = true;
                }
                break;
            }

            case IslandType.Coconut: {
                if (ShipController.camouflageType != IslandType.Coconut)
                {
                    ChangeCamouflagePanel.Panel.transform.Find("Coconut").gameObject.GetComponent <Button>().interactable = true;
                }
                break;
            }

            case IslandType.Rubber: {
                if (ShipController.camouflageType != IslandType.Rubber)
                {
                    ChangeCamouflagePanel.Panel.transform.Find("Rubber").gameObject.GetComponent <Button>().interactable = true;
                }
                break;
            }
            }
        }
        ChangeCamouflagePanel.Toogle();
    }