상속: UnityEngine.MonoBehaviour
예제 #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;
 }
예제 #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);
 }
예제 #4
0
 private void Awake()
 {
     if (c == null)
     {
         DontDestroyOnLoad(gameObject);
         c = this;
     }
     else if (c != this)
     {
         Destroy(gameObject);
     }
 }
예제 #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.");
            }
        }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     cam2d = this.GetComponent <UnityStandardAssets._2D.Camera2DFollow>();
 }