示例#1
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
         return;
     }
     Instance = this;
 }
示例#2
0
        void Start()
        {
            game = GameServices.Instance;

            game.addMoveEvent(setTarget);
            game.addZoomEvent(setZoom);

            InvokeRepeating("moveCamera", 0, Time.deltaTime);
            //InvokeRepeating("zoomCamera", 0, Time.deltaTime);
            targetPos = Position;
            targetZoom = Position.z;
        }