Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        ColorBall tempColorBall = other.gameObject.GetComponent <ColorBall>();

        if (tempColorBall)
        {
            // Don't case equal for now lol
            if ((int)type > (int)tempColorBall.type)
            {
                type      = GeneralTable.Combine(type, tempColorBall.type);
                BallColor = GeneralTable.GetColor(type);

                GamePlayManager.Instance.centerPoint.RemoveEstimateColorBallNum();
            }
            else
            {
                Destroy(this.gameObject);
            }
        }
        CenterPoint tempCenterPoint = other.gameObject.GetComponent <CenterPoint>();

        if (tempCenterPoint)
        {
            nextCenterPoint.match(type);
            ballCollider.enabled = false;
        }
    }
Example #2
0
    // if Color match queue color, add one point, and create another color into queue.
    public bool match(GeneralTable.Type typeValue)
    {
        currentColorBallNum++;

        bool result = false;

        if (!typeValue.Equals(targetTypeQueue.Peek()))
        {
            failFlag = true;
            result   = true;
        }

        if (currentColorBallNum == estimateColorBallNum)
        {
            GamePlayManager.Instance.ResetTimer();
            if (failFlag)
            {
                PerformFail();
            }
            else
            {
                currentPoint++;
                GamePlayManager.Instance.NextStage();
                GeneralTable.Type currentType = targetTypeQueue.Peek();
                while (currentType == targetTypeQueue.Peek())
                {
                    targetTypeQueue.Dequeue();
                    targetTypeQueue.Enqueue(GeneralTable.GetRandomType());
                }
                centerPointMeshRenderer.material.color = GeneralTable.GetColor(targetTypeQueue.Peek());
            }
        }

        return(result);
    }
Example #3
0
 public void DeType(GeneralTable.Type type)
 {
     myType = GeneralTable.Remove(myType, type);
     waypointMeshRenderer.material.color = GeneralTable.GetColor(myType);
     if (colorLine)
     {
         colorLine.RemoveType(type);
     }
     if (colorLines.Length > 0)
     {
         colorLines[nextWaypointIndex].RemoveType(type);
     }
 }
Example #4
0
 public void RemoveType(GeneralTable.Type type)
 {
     colorType = GeneralTable.Remove(type, colorType);
     colorLineRenderer.material.color = GeneralTable.GetColor(colorType);
 }
Example #5
0
 public void AddType(GeneralTable.Type type)
 {
     colorType = GeneralTable.Combine(type, colorType);
     colorLineRenderer.material.color = GeneralTable.GetColor(colorType);
 }