예제 #1
0
 // Use this for initialization
 void Start()
 {
     Myo      = GameObject.Find("Myo");
     me       = this;
     BaseX    = transform.localScale.x;
     BaseY    = transform.localScale.y;
     BaseZ    = transform.localScale.z;
     RocketCD = 0;
     FlameCD  = 0;
     RenderTitle();
     //initialOrientation = transform.rotation;
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        transform.Translate(directionVector, Space.World);
        if (transform.position.x < 2.0f)
        {
            Debug.Log("Print I AM ANGRY");
            if (transform.position.x > -2.0f)
            {
                Debug.Log("I am VERY angry");
                if (transform.position.z > -12.0f)
                {
                    Debug.Log("I am ZZZZ angry");
                    if (transform.position.z < -8.0f)
                    {
                        Debug.Log("I am ARGH angry");
                        MyoTrack.endGame();
                    }
                }
            }
        }
        time += Time.deltaTime;
        Vector3 modificationVector = Vector3.zero;

        if (level == 3)
        {
            modificationVector.z = 0.09f * Mathf.Sin(3.1f * time + 1f);
        }
        if (level >= 2)
        {
            modificationVector.y = 0.06f * Mathf.Cos(1.5f * time);
        }
        if (level >= 1)
        {
            modificationVector.x = 0.04f * Mathf.Sin(time);
        }
        transform.Translate(directionVector + modificationVector, Space.World);
    }