public void GetMonoAValue()
 {
     if (this.monoA == null)
     {
         this.monoA = this.gameObject.GetComponent <MonoA>();
     }
     return(this.monoA.Value);
 }
Пример #2
0
    public void CreateMonoA()
    {
        Log("Before new object is created");
        GameObject newObject = new GameObject();

        Log("Before AddComponent");
        MonoA monoA = newObject.AddComponent <MonoA>();

        Log("MonoA component is just added");
        monoA.Hello();
    }
Пример #3
0
    public void InstantMonoA()
    {
        Log("Before instantiate");
        GameObject newObject = GameObject.Instantiate(monoAPrefab);

        Log("After instantiated");
        MonoA monoA = newObject.GetComponent <MonoA>();

        monoA.Hello();
        newObject.SetActive(true);
    }
 public void Init()
 {
     this.monoA = this.gameObject.GetComponent <MonoA>();
 }