Beispiel #1
0
    void CheckPointer()
    {
        Debug.Log("Direction Magnitude " + joy.Direction.magnitude);
        if (joy.Direction.magnitude == 0f && !released && loading && blastMode != BlastMode.None)
        {
            planetManager.AddStatsBtnEnd();
            released  = true;
            loading   = false;
            blast     = null;
            blastMode = BlastMode.None;
        }
        else if (joy.Direction.magnitude > 0.001f && !loading && blastMode == BlastMode.None)
        {
            Debug.Log("We're here 1");
            released = false;
            if (joy.Vertical > 0.5f && (joy.Horizontal < 0.5f && joy.Horizontal > -0.5f))
            {
                blastMode = BlastMode.Green;
                blast     = greenBlast;
            }
            else if (joy.Vertical < -0.5f && (joy.Horizontal < 0.5f && joy.Horizontal > -0.5f))
            {
                blastMode = BlastMode.Hot;
                blast     = hotBlast;
            }
            else if (joy.Horizontal > 0.5f && (joy.Vertical < 0.5f && joy.Vertical > -0.5f))
            {
                blastMode = BlastMode.Earth;
                blast     = earthBlast;
            }
            else if (joy.Horizontal < -0.5f && (joy.Vertical < 0.5f && joy.Vertical > -0.5f))
            {
                blastMode = BlastMode.Water;
                blast     = waterBlast;
            }

            if (blastMode != BlastMode.None)
            {
                Debug.Log("We're here");
                loading = true;
                GameObject temp = Instantiate(blast, blastParent);
                planetManager.AddStatsBtnStart(temp);
            }
        }
    }