How to add programatically animationClips to one animation from Resources folder?
I'm trying to get the animationClips from the folder called "Resources", but here's the deal, i don't know how to do it because aparently, all the Clips are just some frames in an animation script, is that right?
Please, have in consideration than i'm trying to get the animation populated to create a GameObject just by c#, so, it would be cool if you in your answer include a way to include this animation, through code, to an animator also generated in C#, in order to work with uNET after (which is the final objective of all of this).
Another thing, the object i'm creating is actualy "already created" but i'm trying to re-created using code so to avoid the local duplication of GameComponents when creating objects.
this is the code so far (it correspond to the "PlayerBuilder" entity):
using UnityEngine;
using System.Collections;
public class ControllerMacaroner : MonoBehaviour {
// Use this for initialization
void Start () {
GameObject skellNew = new GameObject ("skeletonDark");
skellNew.AddComponent<Animation> ();
//skellNew.GetComponent<Animation>().AddClip("run", );
}
skellNew.Animation = Resources.Load<Animation>("SkeletonData/animations");
// Update is called once per frame
void Update () {
}
}
Your answer
Follow this Question
Related Questions
Animating in c# 1 Answer
Can't play an animation from the Animator 1 Answer
When rotating on animation, rotation is reset 0 Answers
Advice on how to proceed/Which technique to use [Weapon Animation] 0 Answers
Range Attack + Animation Script 0 Answers