// Use this for initialization private void Start() { staticCam = this; m_LastTargetPosition = target.position; m_OffsetZ = (transform.position - target.position).z; transform.parent = null; }
// Use this for initialization private void Start() { m_LastTargetPosition = target.position; m_OffsetZ = (transform.position - target.position).z; transform.parent = null; SwitchFollow = this; cameraSize = Camera.main.orthographicSize; }
void Awake(){ if (instance == null) { instance = this; GameObject.DontDestroyOnLoad(gameObject); } else GameObject.Destroy(gameObject); }
private void Awake() { if (c == null) { DontDestroyOnLoad(gameObject); c = this; } else if (c != this) { Destroy(gameObject); } }
// Use this for initialization private void Start() { Follow = this; m_LastTargetPosition = target.position; m_OffsetZ = (transform.position - target.position).z; transform.parent = null; // if target not set, then set it to the player if (target == null) { target = GameObject.FindGameObjectWithTag("Player").transform; } if (target == null) { Debug.LogError("Target not set on Camera2DFollow."); } }
// Use this for initialization void Start() { cam2d = this.GetComponent <UnityStandardAssets._2D.Camera2DFollow>(); }