Ejemplo n.º 1
0
 void OnValidate()
 {
     if (!attachedPlayer)
     {
         attachedPlayer = FindObjectOfType <StickyJumper>();
     }
 }
Ejemplo n.º 2
0
    void OnValidate()
    {
        if (!attachedPlayer)
        {
            attachedPlayer = FindObjectOfType <StickyJumper>();
        }

        float[] rotations = new float[4]
        {
            0, -90, 180, 90
        };

        transform.localEulerAngles = new Vector3(0, 0, rotations[direction]);
    }