コード例 #1
0
 private void Start()
 {
     playerRigidbody                = GetComponent <Rigidbody>();
     gameManager                    = FindObjectOfType <OldGameManager>();
     uiTexts                        = FindObjectOfType <OldUITexts>();
     hasKilledTextCurrentTime       = hasKilledTextTime;
     hasBeenKilledTextCurrentTime   = hasBeenKilledTextTime;
     gameManager.myPlayerController = this;
 }
コード例 #2
0
    private void CheckSingeltonInstance()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     GameManagerScript = GameManagerObject.GetComponent <OldGameManager>();
     playerTransform   = GetComponent <Transform>();
     cameraTransform   = CameraObject.GetComponent <Transform>();
     playerRigidBody   = GetComponent <Rigidbody>();
     playerCollider    = GetComponent <CapsuleCollider>();
     yaw   = playerTransform.eulerAngles.y;
     pitch = playerTransform.eulerAngles.x;
 }
コード例 #4
0
    void Awake()
    {
        if (inst == null)
        {
            inst = this;
        }
        else if (inst != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        if (isTesting)
        {
            return;
        }
    }