コード例 #1
0
    public void Appear()
    {
        //random colour index
        while (colourIndex == GameManager.instance.colourIndex)
        {
            colourIndex = Random.Range(0, colours.Length);
        }

        //set the enum colour type
        colour = HelperFunctions.SetColourType(colourIndex);
        //set the background colour
        backgroundImage.color = colours[colourIndex];

        if (portraitView)
        {
            //make the background appear
            backgroundImage.transform.DOScaleX(1.0f, 1.0f).SetEase(Ease.OutBack, 0.5f, 1.0f).OnComplete(() => {
                isVisible = true;
            });
        }
        else
        {
            backgroundImage.transform.DOScaleY(0.3333f, 1.0f).SetEase(Ease.OutBack, 0.5f, 1.0f).OnComplete(() => {
                isVisible = true;
            });
        }
    }
コード例 #2
0
 public static bool CompareColour(GameManager.ColourType a, GameManager.ColourType b)
 {
     if (a == b)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #3
0
    public Color NextColour()
    {
        colourIndex++;

        if (colourIndex > colours.Length - 1)
        {
            colourIndex = 0;
        }

        colour = HelperFunctions.SetColourType(colourIndex);

        //if there is a background quad behind the node im currently at
        if (currentNode.bq.isVisible)
        {
            GameManager.instance.SetGamePlayVariables(currentNode.bq.colour);             //check against the background quad
        }
        else
        {
            GameManager.instance.SetGamePlayVariables(GameManager.instance.currentColour);              //check against the whole background
        }
        return(colours [colourIndex]);
    }