This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System; | |
public class ActionDemo : MonoBehaviour { | |
void Start(){ | |
Action<string> SampleAction; //action dont need an explicit delegate to be declared (Action is special kind of delegate which takes parameters but returns nothing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Anim : MonoBehaviour { | |
public GameObject cg; | |
public RuntimeAnimatorController animator; | |
void Start () { | |
cg.gameObject.AddComponent<Animator>(); | |
cg.gameObject.GetComponent<Animator>().runtimeAnimatorController = animator; |