Inheritance: MonoBehaviour
Example #1
0
    void Start()
    {
        player         = GameObject.Find("Player").GetComponent <Player>();
        playerMovement = GameObject.Find("Player").GetComponent <FirstPersonDrifter>();
        mainCamera     = GameObject.Find("Main Camera").GetComponent <Camera>();

        allComplete       = false;
        renderer.material = painting;
        //renderer.material.color = Color.grey;
        //textMaterial.color = new Color(0.8f, 0.8f, 0.8f, 1);

        processedWords = new ArrayList();
        finished       = false;
        canType        = false;

        promptText = "Press spacebar to interact";
        hasEntered = false;

        // Particle effects
        // MAX: 2
        particleBlock = 2.0f / maxZen;

        levelProgress      = GameObject.Find("Level Information").GetComponent <LevelInformation>();
        textMaterial.color = new Color(textMaterial.color.r, textMaterial.color.g, textMaterial.color.b, 0);
    }
Example #2
0
 void Start()
 {
     mainController = main.GetComponent <MainController>();
     startPos       = new Vector3(transform.position.x, transform.position.y, transform.position.z);
     drifter        = GetComponent <FirstPersonDrifter>();
     mouseLook      = GetComponent <MouseLook>();
     cam            = GameObject.Find("Main Camera").GetComponent <Camera>();
 }
Example #3
0
	// Use this for initialization
	void Start () {
		drifter = GetComponent<FirstPersonDrifter>();
		mouseLook = GetComponent<MouseLook>();
		mouseLookVert = Camera.main.GetComponent<MouseLook>();
		arcBall = holdPosition.GetComponent<ArcBall>();
		currentTarget = holdPositionTarget;

	}
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     print("started being a player");
     input   = GetComponent <PlayerInput>();
     fpdtest = GetComponent <FirstPersonDrifter>();
     print(input);
     print(fpdtest);
 }
Example #5
0
    // Use this for initialization
    void Start()
    {
        player        = GameObject.Find("Player");
        playerDrifter = player.GetComponent <FirstPersonDrifter>();
        player.GetComponent <PlayerGUI>().wordsAlpha = 1;

        levelProgress = GameObject.Find("Level Information").GetComponent <LevelInformation>();
    }
Example #6
0
    void Start()
    {
        input    = GetComponent <PlayerInput>();
        movement = GetComponent <FirstPersonDrifter>();
        xLook    = GetComponent <MouseLook>();
        bgm      = GetComponent <AudioSource>();

        GoToUpWorld();
    }
    void Start()
    {
        Screen.lockCursor = true;
        //Screen.showCursor = false;

        wordsInventory = GetComponent <Player>().currentWords;
        playerDrifter  = GetComponent <FirstPersonDrifter>();
        //zen = GetComponent<Player>().zen;
        words = GetComponent <Player>().words;
    }
Example #8
0
        void Awake()
        {
            _instance = this;

            _fps = GetComponent <FirstPersonDrifter>();
            _mouseLookHorizontal = GetComponent <MouseLook>();
            _mouseLookVertical   = head.GetComponent <MouseLook>();
            controller           = GetComponent <CharacterController>();

            SwitchControlMode(ControlMode.FirstPerson);
        }
Example #9
0
    void Start()
    {
        Screen.lockCursor = true;
        Screen.showCursor = false;

        wordsInventory = GetComponent <Player>().currentWords;
        playerDrifter  = GetComponent <FirstPersonDrifter>();
        zen            = GetComponent <Player>().zen;
        words          = GetComponent <Player>().words;

        levelProgress = GameObject.Find("Level Information").GetComponent <LevelInformation>();
    }
Example #10
0
 void Start()
 {
     drifter = GetComponent <FirstPersonDrifter>();
     cam     = GetComponentInChildren <Camera>();
     for (var i = 0; i < container.transform.childCount; ++i)
     {
         var arm = container.transform.GetChild(i);
         init.Add(arm.transform.eulerAngles);
         meshes.Add(arm.transform.Find("mesh"));
         armUp.Add(arm.transform.Find("up"));
         armDown.Add(arm.transform.Find("down"));
         armOut.Add(arm.transform.Find("out"));
     }
 }
Example #11
0
    //  public Animator playerani;

    // Use this for initialization
    void Start()
    {
        player           = GetComponent <FirstPersonDrifter>();
        mainCam.enabled  = true;
        photoCam.enabled = false;
        invCam.enabled   = false;
        player.enabled   = true;
        me.enabled       = true;
        but1.enabled     = true;
        but2.enabled     = true;
        but3.enabled     = true;
        but4.enabled     = true;
        but5.enabled     = true;
        but6.enabled     = true;

        // playerani.enabled = true;
    }
Example #12
0
    public void TurnOff()
    {
        MouseLook mouse = cam.GetComponent <MouseLook>();

        mouse.enabled = false;

        MouseLook playerMouse = player.GetComponent <MouseLook>();

        playerMouse.enabled = false;

        CharacterController controler = player.GetComponent <CharacterController>();

        controler.enabled = false;

        FirstPersonDrifter fps = player.GetComponent <FirstPersonDrifter>();

        fps.enabled = false;
    }
Example #13
0
    // init
    private void Awake()
    {
        playerInput   = GetComponent <PlayerInput>();
        fpsController = GetComponent <FirstPersonDrifter>();
        foreach (Transform child in spellContainer)
        {
            ISpell spell = child.GetComponent <ISpell>();
            // Ignore transforms that don't have spells on them, but we will warn
            if (spell != null)
            {
                acquiredSpells.Add(child.GetComponent <ISpell>());
                child.gameObject.SetActive(false);
            }
            else
            {
                Debug.LogWarning(child.name + " has no spell attached!");
            }
        }

        currentSpell = acquiredSpells[0];
        currentSpell.Equip(this);
    }
Example #14
0
    void CreatePlayer()
    {
        int   playerIndex = mapBuilder.GetIndexOfThing(1);
        Thing playerThing = mapBuilder.map.things[playerIndex];
        float playerScale = 0.6f;

        if (player != null)
        {
            GameObject.Destroy(player);
        }

        player      = Instantiate(playerPrefab);
        player.name = "Player";
        player.transform.localScale = new Vector3(playerScale, playerScale, playerScale);
        player.transform.position   = new Vector3(playerThing.x * DoomMapBuilder.SCALE,
                                                  (mapBuilder.thingSectors[playerIndex].floorHeight + DoomMapBuilder.PLAYER_HEIGHT) * DoomMapBuilder.SCALE * 1.2f,
                                                  playerThing.y * DoomMapBuilder.SCALE);
        player.transform.localEulerAngles = new Vector3(0f, 90f - playerThing.angle, 0f);
        fpd = player.GetComponent <FirstPersonDrifter>();

        player.transform.Find("Main Camera").GetComponent <MouseLook>().enabled = (Settings.Get("MOUSE_VLOOK", "false") == "true");
    }
Example #15
0
        public void SwitchSounds(AudioClip Footsteps, AudioClip Jump, AudioClip Land, AudioClip Air)
        {
            FirstPersonDrifter fp = GetComponent <FirstPersonDrifter>();

            if (Footsteps != null)
            {
                fp.footstepSource.clip = Footsteps;
                fp.footstepSource.Play();
            }
            if (Jump != null)
            {
                fp.jumpSource.clip = Jump;
            }
            if (Land != null)
            {
                fp.landSource.clip = Land;
            }
            if (Air != null)
            {
                fp.airSource.clip = Air;
                fp.airSource.Play();
            }
        }
Example #16
0
 void Start()
 {
     headBob = GetComponentInChildren<HeadBob>();
     fpd = GetComponent<FirstPersonDrifter>();
 }
Example #17
0
 void Start()
 {
     stepSound = GetComponent <AudioSource>();
     last      = transform.localPosition.y;
     player    = FindObjectOfType <FirstPersonDrifter>();
 }
Example #18
0
 void Start()
 {
     drifter = GetComponent<FirstPersonDrifter>();
     StartCoroutine(FootstepLoop());
 }
 // Use this for initialization
 void Start()
 {
     fpd     = GetComponent <FirstPersonDrifter> ();
     headBob = GetComponentInChildren <HeadBob> ();
 }
Example #20
0
 private void SetComponents()
 {
     m_Drifter = GetComponent <FirstPersonDrifter>();
 }
 // Use this for initialization
 void Start()
 {
     controller      = GetComponent <FirstPersonDrifter>();
     spellController = GetComponent <SpellController>();
     playerInput     = GetComponent <PlayerInput>();
 }