示例#1
0
    void Start()
    {
        // Grab references.
        thisObject = gameObject;
        textBox    = GetComponentInChildren <ScrollingText>();
        if (GameObject.FindGameObjectWithTag("Player") != null)
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        }
        starterName = starterNameRef;
        nameBox     = nameBoxRef;

        // Set initial values of sensitivity temps.
        if (player != null)
        {
            sensitivityXTemp = player.mouseLook.XSensitivity;
            sensitivityYTemp = player.mouseLook.YSensitivity;
        }

        // Disable to start with.
        FakeActive(gameObject, false);

        // prevents problem with OnEnable() calling Start() AFTER a trigger has been enabled
        if (currentlyEnabled)
        {
            FakeActive(gameObject, true);
        }
    }
示例#2
0
 void Start()
 {
     Player           = GameObject.FindGameObjectWithTag("Player");
     PlayerRigidbody  = Player.GetComponent <Rigidbody>();
     VelocityDetector = Player.GetComponent <VelocityDetection>();
     RbdController    = Player.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
 }
示例#3
0
 protected virtual void Start()
 {
     deadYet     = false;
     audioSource = GetComponent <AudioSource>();
     controller  = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
     squashing   = false;
 }
示例#4
0
    void Start()
    {
        PartsFound = new bool[4];
        Movement   = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        anim       = GetComponent <Animation>();
        Root       = transform.parent.gameObject;

        StartSpeed = Movement.movementSettings.ForwardSpeed;
        SetStats();
    }
示例#5
0
 // Use this for initialization
 void Start()
 {
     rb           = GetComponent <Rigidbody>();
     rbController = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
     origin       = transform.Find("LeashOrigin");
     line         = origin.GetComponent <LineRenderer>();
     light        = GetComponentInChildren <Light>();
     audioSource  = GetComponent <AudioSource>();
     attached     = false;
 }
示例#6
0
    void Start()
    {
        hookRb           = GetComponent <Rigidbody> ();
        playerRb         = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody> ();
        playerController = playerRb.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController> ();

        hookRb.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;

        Invoke("Expire", lifetime);
    }
示例#7
0
    public override void DisableMounting(Vector3 Laspos)
    {
        base.DisableMounting(Laspos);

        UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController RFPC = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        if (RFPC)
        {
            RFPC.mouseLook.Init(HorseCntler.transform, HorseCntler.transform);
        }
    }
示例#8
0
 public override void EnableMounting()
 {
     base.EnableMounting();
     transform.parent   = HorseCntler.transform;
     transform.rotation = HorseCntler.transform.rotation;
     UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController RFPC = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
     if (RFPC)
     {
         RFPC.mouseLook.Init(transform, transform);
     }
 }
示例#9
0
    //tell the script if the charcter has hit the target point when they are on the top of the ladder

    public void Start()
    {
        if (transform.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController> ())
        {
            controller = transform.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController> ();
        }
        if (transform.GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController> ())
        {
            controller2 = transform.GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController> ();
        }
    }
示例#10
0
    public void placeMnemonic()
    {
        Vector3 forward  = UnityEngine.XR.InputTracking.GetLocalRotation(UnityEngine.XR.XRNode.CenterEye) * cam.transform.forward;
        Vector3 spawnPos = cam.transform.position + forward * 2;

        GameObject mnemonic = generateMnemonic();

        GameObject.Instantiate(mnemonic, spawnPos, Quaternion.identity);
        UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController instance = new UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController();
        instance.Move(new Vector2(-1, 0), 4f);
        // GameObject.Instantiate(mnemonic, getMnemonicPosition(), Quaternion.identity);
    }
    private void Start()
    {
        fpsCamera     = GetComponentInChildren <Camera>();
        fpsController = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();

        InitializeGun();

        reloadSymbol = fpsCamera.gameObject.transform.Find("Reload Symbol").gameObject;
        reloadSymbol.SetActive(false);
        reloadingSymbol = fpsCamera.gameObject.transform.Find("Reloading Symbol").gameObject;
        reloadingSymbol.SetActive(false);
    }
    //public UIBuilder solarPanelProductionBoard;

    // Use this for initialization
    void Start()
    {
        //solarPanelProductionBoard = new UIBuilder();
        controller       = transform.parent.GetComponent <RigidbodyFirstPersonController>();
        InventoryAccess  = gameObject.GetComponentInParent <OldObjectSystem>();
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
        ConsoleUI.gameObject.SetActive(false);
        TextField.gameObject.SetActive(false);
        PlaceOlder = (GameObject)Instantiate(Resources.Load("user.placeOlder"), Vector3.zero, Quaternion.identity);
        GetPO      = PlaceOlder.GetComponent <PlaceOlder>();
    }
示例#13
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        EntityType type = EntityType.Player;

        AddType(type);

        playerControls = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        gunController  = GetComponent <GunController>();

        defaultSpeed = playerControls.movementSettings.ForwardSpeed;

        buffed    = false;
        buffTimer = 0.0f;
    }
示例#14
0
 // Use this for initialization
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     playerTransform = player.transform;
     nav             = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     animator        = GetComponent <Animator>();
     playerHealth    = player.GetComponent <PlayerHealth>();
     rb = player.GetComponent <Rigidbody>();
     s  = player.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController> ();
     s.movementSettings.ForwardSpeed  = 12f;
     s.movementSettings.BackwardSpeed = 8f;
     stopTimer  = -1f;
     inMotion   = false;
     bossHealth = GetComponent <BossHealth> ();
 }
示例#15
0
    // Use this for initialization
    void Start()
    {
        ChangeScene cs = new ChangeScene();

        currentHealth = cs.getHealthData();
        print(currentHealth);

        //currentHealth = startingHealth;
        playerMovement = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        damageImage    = GameObject.Find("DamageImage").GetComponents <RawImage>()[0];
        GameObject[] objs = GameObject.FindGameObjectsWithTag("HP");
        HPbars = new List <RawImage> ();
        for (int i = 0; i < objs.Length; i++)
        {
            HPbars.Add(objs [i].GetComponent <RawImage> ());
        }
        HealthChange();
    }
示例#16
0
    void Start()
    {
        // Grabbing references.
        //player = Reference.Instance().player;
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
        //tabButtonY = tabButtons[1].transform.localPosition.y;

        // Will be closed on run, so disable all menus.
        // Grab initial sensitivity settings first, though, or they will zero.
        sensitivityXTemp = player.mouseLook.XSensitivity;
        sensitivityYTemp = player.mouseLook.YSensitivity;

        // Also ensure everything is populated when initialized.
        // We do this literally everywhere because script run order is not
        // defined in Unity... Keeps things interesting, I guess.
        invPop.Repopulate();
        recPop.Repopulate();

        CloseInventory();
    }
 void Start()
 {
     controller = GetComponent<UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
 }
示例#18
0
 void Awake()
 {
     CreateInitialFiles();
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
 }
 void Awake()
 {
     inGrav = true;
     observableText = GameObject.Find("Canvas/ObservableText").GetComponent<Text>();
     controller = GetComponent<UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
 }
示例#20
0
 void Start()
 {
     //get some necessary stuff so I don't have to keep asking for the ref's
     controller = gameObject.GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
     rb         = gameObject.GetComponent <Rigidbody>();
 }
示例#21
0
 void Start()
 {
     controller = GetComponent <RigidbodyFirstPersonController>();
     mouseLook.Init(transform, Camera.main.transform);
 }
示例#22
0
        public static void UnLoadGame()
        {
            TriggerManager.SendEvent(Event.GameEnded);

            if (selectedModelSetup == null)
            {
                UnityEngine.Debug.Log("Launcher:  model setup not found");
                if (selectedModelSetup == null)
                {
                    UnityEngine.Debug.Log("Launcher: selected model setup not found");
                }
                return;
            }
            List <EmulatorConfiguration> emulatorConfiguration = ArcadeManager.emulatorsConfigurationList.Where(x => x.emulator.id == gameModelSetup.emulator).ToList();

            if (emulatorConfiguration.Count < 1)
            {
                UnityEngine.Debug.Log("Launcher: no emulator configuration found");
                return;
            }
            selectedModelSetup.isPlaying = false;
            var launcherMethod = GameLauncherMethod.None;

            launcherMethod = gameModelSetup.gameLauncherMethod;
            if (launcherMethod == GameLauncherMethod.None)
            {
                System.Enum.TryParse(emulatorConfiguration[0].emulator.gameLauncherMethod, true, out launcherMethod);
            }
            if (launcherMethod == GameLauncherMethod.None)
            {
                System.Enum.TryParse(selectedModelSetup == gameModelSetup ? ArcadeManager.arcadeConfiguration.gameLauncherMethod : ArcadeManager.menuConfiguration.gameLauncherMethod, true, out launcherMethod);
            }
            switch (launcherMethod)
            {
            case GameLauncherMethod.Internal:
                UnLoadInternalGame();
                break;

            case GameLauncherMethod.External:
                UnLoadExternalGame();
                break;

            case GameLauncherMethod.URL:
                UnLoadExternalGame();
                break;

            default:
                UnityEngine.Debug.Log("Launcher: no launcher method found");
                break;
            }
            void UnLoadExternalGame()
            {
                // Stop Game
                ArcadeManager.arcadeState = ArcadeStates.Running;
            }

            void UnLoadInternalGame()
            {
                // Stop Game
                ModelLibretroGameSetup libretroGame = selectedModelSetup.gameObject.GetComponent <ModelLibretroGameSetup>();

                if (libretroGame != null)
                {
                    libretroGame.PauseGame(false, true, true);
                }
                Cursor.lockState          = CursorLockMode.Locked;
                Cursor.visible            = false;
                ArcadeManager.arcadeState = ArcadeStates.Running;
                if (ArcadeManager.activeMenuType != ArcadeType.None || (ArcadeManager.activeMenuType == ArcadeType.None && ArcadeManager.activeArcadeType == ArcadeType.FpsArcade))
                {
                    UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController arcadeRigidbodyFirstPersonController = ArcadeManager.arcadeControls[ArcadeType.FpsArcade].GetComponent <RigidbodyFirstPersonController>();
                    if (arcadeRigidbodyFirstPersonController != null)
                    {
                        arcadeRigidbodyFirstPersonController.pause = false;
                    }
                }
            }
        }
 void Awake()
 {
     controller = FindObjectOfType <RigidbodyFirstPersonController> ();
     rb         = FindObjectOfType <Rigidbody> ();
 }
示例#24
0
 void Awake( )
 {
     cc = GetComponent <UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>();
     rb = GetComponent <Rigidbody>();
 }