Example #1
0
    void Start()
    {
        thePlayer = FindObjectOfType <Moveman>();
        if (thePlayer.startpoint == pointname)
        {
            thePlayer.transform.position = transform.position;

            theCamera = FindObjectOfType <Cameraattach>();
            theCamera.transform.position = new Vector3(transform.position.x, transform.position.y, theCamera.transform.position.z);
        }
    }
Example #2
0
 void Start()
 {
     if (instanceRef == null)
     {
         instanceRef = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }