예제 #1
0
 void Start()
 {
     if(!playerToControl)
     {
         playerToControl = GetComponent<CharacterController3D>();
     }
 }
예제 #2
0
    void Awake()
    {
        _animator = GetComponent<Animator>();
        _controller = GetComponent<CharacterController3D>();
        rb = gameObject.GetComponent<Rigidbody>();

        // listen to some events for illustration purposes
        _controller.onControllerCollidedEvent += onControllerCollider;
        _controller.onTriggerEnterEvent += onTriggerEnterEvent;
        _controller.onTriggerExitEvent += onTriggerExitEvent;

        Vector3 globalPos = rb.position;
        tideController = GameObject.FindGameObjectWithTag("GameController").GetComponent<TideController>();
        lungsController = this.GetComponent<PlayerLungs>();
    }
예제 #3
0
    void Start()
    {
        animScript = GetComponent <NetworkAnimScript>();
        if (isLocalPlayer)
        {
            cc       = GetComponent <CharacterController3D>();
            input    = GetComponent <CharacterInput>();
            splatMat = splatPanel.GetComponent <Image>().material;
            deathMat = deathPanel.GetComponent <Image>().material;
            deathMat.SetFloat("_FadeToBlack", 0f);
            spawnPoints    = FindObjectsOfType <NetworkStartPosition>();
            spawnLocations = GameObject.FindGameObjectsWithTag("Spawn Location");
        }
        va          = GetComponent <VoiceActing>();
        colliderPos = GetComponent <CapsuleCollider>().center;
        if (isServer)
        {
            scores = GameObject.Find("Score Manager").GetComponent <ScoreManager>();
        }
        int netID = (int)GetComponent <NetworkIdentity>().netId.Value;

        audioS = GetComponent <AudioSource>();
    }