Inheritance: UnityEngine.MonoBehaviour
Exemplo n.º 1
0
 // Use this for initialization
 private void Start()
 {
     staticCam            = this;
     m_LastTargetPosition = target.position;
     m_OffsetZ            = (transform.position - target.position).z;
     transform.parent     = null;
 }
Exemplo n.º 2
0
 // 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);
 }
Exemplo n.º 4
0
 private void Awake()
 {
     if (c == null)
     {
         DontDestroyOnLoad(gameObject);
         c = this;
     }
     else if (c != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 5
0
        // 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.");
            }
        }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     cam2d = this.GetComponent <UnityStandardAssets._2D.Camera2DFollow>();
 }