Search Unity

Is it possible to animate int,double,enum inside animation window?

Discussion in 'Animation' started by colin299, Oct 9, 2015.

  1. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    this simple script will expose field to unity inspector

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Debug_AnimateIntEnum : MonoBehaviour {
    5.  
    6.     //can NOT animate
    7.     public int myInt = 1;
    8.     public uint myUInt = 3;
    9.     public AnyEnum myEnum = AnyEnum.Default;
    10.     public double myDouble;
    11.  
    12.     //can animate
    13.     public float myFloat = 2f;
    14.     public bool myBool = false;
    15.     public Color myColor;
    16.     public Texture myTexture;
    17.     public AudioClip myAudioClip;
    18.     public Vector3 myVector3;
    19.     public Mesh myMesh;
    20.     public RenderTexture myRenderTexture;
    21.     public AnimationClip myAnimationClip;
    22.  
    23.  
    24.     public enum AnyEnum
    25.     {
    26.         Default,
    27.         A,
    28.         B,
    29.         C
    30.     }
    31. }
    32.  

    Only field that can be animated will turn to red

    but int,uint,enum,double will not allow animate in animation window,
    Is it by Unity's design? if Yes, I wonder the reason behind it,
    because it is totally not reasonable to me.