Ejemplo n.º 1
0
 public void OnEditorGUI()
 {
     animator = (VoxelAnimator)target;
     EditorGUILayout.BeginHorizontal(GUILayout.Width(paramViewWidth));
     ParameterView();
     EditorGUILayout.EndHorizontal();
 }
 void AddToAnimationList(List <VoxelAnimator> lstAnimations, VoxelAnimator anim)
 {
     if (anim != null)
     {
         lstAnimations.Add(anim);
     }
 }
Ejemplo n.º 3
0
    void Awake()
    {
        forward   = Camera.main.transform.forward;
        forward.y = 0;
        forward.Normalize();
        right = Quaternion.Euler(new Vector3(0, 90, 0)) * forward;

        rb               = GetComponent <Rigidbody>();
        playerInput      = GetComponent <PlayerInputHandler>();
        playerController = GetComponent <PlayerController>();
        minInput         = playerController.GetMinInput();
        buildUpRot       = playerController.GetBuildUpRot();
        animator         = GetComponent <VoxelAnimator>();
    }
Ejemplo n.º 4
0
    void ParameterColumn()
    {
        bool recreateEditor = false;

        EditorGUILayout.BeginVertical(GUILayout.Width(paramViewHeight));
        if (Selection.activeGameObject != selected)
        {
            recreateEditor = true;
            selected       = Selection.activeGameObject;
        }
        if (selected != null)
        {
            animator = selected.GetComponent <VoxelAnimator>();
            if (animator != null)
            {
                if (recreateEditor)
                {
                    editor = (VoxelAnimatorEditor)Editor.CreateEditor(animator);
                }
                editor.OnEditorGUI();
            }
        }
        EditorGUILayout.EndVertical();
    }