Exemplo n.º 1
0
 void Awake()
 {
     sidePosition = new Vector3(10, 7, 0);
     abovePosition = new Vector3(0, 10, 0);
     behindPosition = new Vector3(0, 0, -10);
     currentCamPosition = CameraPosition.Side;
     currentMaterial = BallMaterial.Rubber;
     Size = PlayerSizes.Small;
 }
Exemplo n.º 2
0
    void FixedUpdate()
    {
        print(currentKey);

        if(!Input.anyKey)
            currentKey = KeyCode.None;

        if(Input.GetKey(KeyCode.PageUp))
        {
            currentKey = KeyCode.PageUp;

            if(previousKey != currentKey)
            {
                if(Size == PlayerSizes.Small)
                {
                    Size = PlayerSizes.Medium;
                    animation["SmallMed"].speed = 2;
                    animation.Play("SmallMed");
                }
                else if(Size == PlayerSizes.Medium)
                {
                    Size = PlayerSizes.Large;
                    animation["MedLrg"].speed = 2;
                    animation.Play("MedLrg");
                }
            }
        }

        if(Input.GetKey(KeyCode.PageDown))
        {
            currentKey = KeyCode.PageDown;

            if(previousKey != currentKey)
            {
                if(Size == PlayerSizes.Medium)
                {
                    animation["SmallMed"].speed = -2;
                    animation["SmallMed"].time = animation["SmallMed"].length;
                    animation.Play("SmallMed");
                    Size = PlayerSizes.Small;
                }
                else if(Size == PlayerSizes.Large)
                {
                    animation["MedLrg"].speed = -2;
                    animation["MedLrg"].time = animation["MedLrg"].length;
                    animation.Play("MedLrg");
                    Size = PlayerSizes.Medium;
                }
            }
        }

        previousKey = currentKey;
    }
Exemplo n.º 3
0
 private static extern void FCE_Document_SetPlayerSize(PlayerSizes size);
Exemplo n.º 4
0
 // Update is called once per frame
 void Awake()
 {
     Size = PlayerSizes.Small;
 }
Exemplo n.º 5
0
 void ShrinkPlayer()
 {
     if(Size == PlayerSizes.Medium)
     {
         animation["SmallMed"].speed = -2;
         animation["SmallMed"].time = animation["SmallMed"].length;
         animation.Play("SmallMed");
         Size = PlayerSizes.Small;
     }
     else if(Size == PlayerSizes.Large)
     {
         animation["MedLrg"].speed = -2;
         animation["MedLrg"].time = animation["MedLrg"].length;
         animation.Play("MedLrg");
         Size = PlayerSizes.Medium;
     }
 }
Exemplo n.º 6
0
    void GrowPlayer()
    {
        if(isGrounded())
            rigidbody.AddForce(Vector3.up); //Add a bit of force to avoid sinking into floor

        if(Size == PlayerSizes.Small)
        {
            Size = PlayerSizes.Medium;
            animation["SmallMed"].speed = 2;
            animation.Play("SmallMed");
        }
        else if(Size == PlayerSizes.Medium)
        {
            Size = PlayerSizes.Large;
            animation["MedLrg"].speed = 2;
            animation.Play("MedLrg");
        }
    }