Inheritance: MonoBehaviour
Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     character        = GetComponent <Rigidbody>();
     mouseLook        = GetComponent <CustomMouseLook>();
     rotator          = GetComponent <CharacterRotator>();
     sMovement        = GetComponent <SurfaceMovement>();
     grappleGun       = GetComponent <GrappleGun>();
     if (grappleGun)
     {
         grappleGun.controller = this;
     }
     grappled  = false;
     justFired = false;
 }
Beispiel #2
0
    void Start()
    {
        if (isLocalPlayer)
        {
            os = SystemInfo.operatingSystemFamily;
            if (Application.isEditor)
            {
                base_dir = Directory.GetCurrentDirectory();
            }
            else
            {
                base_dir = AppDomain.CurrentDomain.BaseDirectory;
            }
            agent = GetComponent <NavMeshAgent>();
            local_navmesh_network = GetComponent <LocalNavMeshNetworkProxy>();
            equipment_controller  = GetComponent <EquipmentController>();
            bag     = GetComponent <Bag>();
            rotator = GetComponent <CharacterRotator>();

            new Script(); //Only to make sure script env dll is loaded on main thread.

            update_script_data();
            cancel_source = new CancellationTokenSource();

            { //Try to execute the environment over and over again
                var thread = new Thread(run_env);
                thread.Name         = "Player Scripting Env";
                thread.IsBackground = true;
                thread.Start();
            }

            { //Create a temporary file and open that with the zerobrane editor
                var thread = code_updater_thread = new Thread(code_editor_watcher);
                thread.Name         = "Code Editor Watcher";
                thread.IsBackground = true;
                thread.Start();
            }
        }
    }
Beispiel #3
0
 private void Awake()
 {
     rotator = GetComponent <CharacterRotator>();
 }
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     character = GetComponent<Rigidbody>();
     mouseLook = GetComponent<CustomMouseLook>();
     rotator = GetComponent<CharacterRotator>();
     sMovement = GetComponent<SurfaceMovement>();
     grappleGun = GetComponent<GrappleGun>();
     if (grappleGun) grappleGun.controller = this;
     grappled = false;
     justFired = false;
 }