Attach() public méthode

Attach the main camera object to the attachment point.
public Attach ( ) : void
Résultat void
Exemple #1
0
 public void Ride()
 {
     if (IsTargetable)
     {
         ScreenFader.Fade(null, () =>
         {
             // Attach the camera to the cart.
             if (attachCamera != null)
             {
                 attachCamera.Attach();
             }
             else
             {
                 Debug.LogError("CartClick: AttachCamera is null.");
             }
         }, () =>
         {
             // Start the cart running its path.
             if (runWithPath != null)
             {
                 runWithPath.enabled = true;
             }
             else
             {
                 Debug.LogError("CartClick: RunWithPath is null.");
             }
         });
     }
 }
    // Use this for initialization
    void Start()
    {
        myNetworkView = GetComponent<NetworkView>();
        sceneCamera =  GameObject.Find("Scene Camera");
        enemyManager = GameObject.Find("EnemyManager");
        attachCamera = GetComponent<AttachCamera>();

        OpponentDestroy();

        if(sceneCamera != null)
            sceneCamera.SetActive(false);

        if (myNetworkView.isMine)
        {
            transform.FindChild("Main Camera").parent = null;
            attachCamera.Initialize();
            attachCamera.Attach();
        }
    }