GameObjectのスクリプトは、GameObjectが非アクティブでも呼べる

f:id:SiunCyclone:20181022180111p:plain

f:id:SiunCyclone:20181022180102p:plain

public class Main : MonoBehaviour {
  void Start() {
    _target.Say();
  }

  [SerializeField] private Target _target;
}
public class Target : MonoBehaviour {
  public void Say() {
    Debug.Log("I'm Target!");
  }
}

f:id:SiunCyclone:20181022180106p:plain

その他

GameObjectが最初から非アクティブであれば、Awake()、Start()、Update()はいずれも呼ばれない

public class Target : MonoBehaviour {
  void Awake() {
    Debug.Log("Target Awake()");
  }

  void Start() {
    Debug.Log("Target Start()");
  }

  void Update() {
    Debug.Log("Target Update()");
  }

  public void Say() {
    Debug.Log("I'm Target!");
  }
}

f:id:SiunCyclone:20181022180615p:plain