UnityPlatformer.InstancePrefab.OnAwake C# (CSharp) 메소드

OnAwake() 공개 메소드

Instance the prefab, rename and attach it
public OnAwake ( bool notify = true ) : void
notify bool true -> SendMessage: OnInstancePrefab
리턴 void
    public virtual void OnAwake(bool notify = true) {
      if (instance == null) {
        instance = Instantiate(prefab, transform.position, transform.rotation) as GameObject;

        instance.name = gameObject.name;
        Rename(instance.transform);
        ++count;

        if (!attachToRoot) {
           instance.transform.parent = gameObject.transform;
        }
      }

      if (notify) {
        SendMessage("OnInstancePrefab", this, SendMessageOptions.DontRequireReceiver);
      }
    }