コード例 #1
0
ファイル: scrPlayer.cs プロジェクト: JPen3/GameJamSpring15
    void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Feather"))
        {
            feathers++;

            if (feathers >= 3)
            {
                rising = true;

                iTween.MoveTo(gameObject, new Vector3(transform.position.x, 5.0F, transform.position.z), 3.0F);

                controller.Rise();
                feathers = 0;
            }
        }

        if (other.tag.Equals("Obstacle"))
        {
            Debug.Log("You hit an obstacle!");
            health--;

            InvokeRepeating("Flash", 0.0F, 0.2F);
        }
    }