Exemplo n.º 1
0
    public override void OnAttach(Player player)
    {
        base.OnAttach(player);

        var render = player.GetComponentInChildren <Renderer>();

        _playerCol            = render.material.color;
        render.material.color = GimmickColor;

        _playerSpeed = player.Speed;
        player.Speed = 0;

        _mouseCamera            = FindObjectOfType <MouseCamera>();
        _mouseCamera.IsTeleport = true;

        var p = ParticleManager.Spawn(
            "GimmickTeleportToEffect",
            Path.GetPoint(EndPoint / Path.LineCount),
            Quaternion.identity,
            WaitTime + 2);

        p.GetAttribute("WaitTime").ValueFloat = WaitTime;
        p.GetAttribute("Radius").ValueFloat   = player.Body.localScale.x / 2;

        AudioManager.PlaySE("magic-drain1");
        StartCoroutine(PlaySEDelay(WaitTime - 0.1f));
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 0; i < _folders.Length; i++)
        {
            if (i == 0)
            {
                _drawerPosition = _folders[0].position;
            }
            else
            {
                _menuFolders[i - 1] = _folders[i].GetComponent <MenuFolder>();
                _menuFolders[i - 1].SetBase();
            }
        }

        for (int i = 0; i < _audioMenuBackgrounds.Length; i++)
        {
            _audioMenuBackgroundTargetsPos[i]         = _audioMenuBackgrounds[i].anchoredPosition;
            _audioMenuBackgroundTargetsRot[i]         = _audioMenuBackgrounds[i].rotation;
            _audioMenuBackgrounds[i].anchoredPosition = audioMenuRoot.anchoredPosition;
            _audioMenuBackgrounds[i].rotation         = audioMenuRoot.rotation;
        }
        _raycastMask = LayerMask.GetMask("MenuFolders");
        _folders[0].Translate(new Vector3(0, 0, .7f));
        StartCoroutine(StartSlideOut(1f));
        pd            = FindObjectOfType <PlayerData>();
        move          = pd.gameObject.GetComponent <Movement>();
        move.isLocked = true;
        mc            = move.gameObject.GetComponentInChildren <MouseCamera>();
        mc.SetCursorNone();
        StartCoroutine(WaitForCam());
    }
Exemplo n.º 3
0
    void Start()
    {
        //TODO: Bugfix to allow .isMine and .owner from AWAKE!
        if (photonView.isMine)
        {

            Camera.main.transform.parent = transform;
            Camera.main.transform.localPosition = cameraRelativePosition;
            Camera.main.transform.localEulerAngles = transform.localEulerAngles;//new Vector3(0, 90, 0);
            Camera.main.farClipPlane = 100.0f;

            if(cameraScript == null)
                cameraScript = GameObject.Find ("Main Camera").GetComponent<MouseCamera>();
            if(playerRotationScript == null)
                playerRotationScript = transform.GetComponent<MouseCamera>();

            //playerRotationScript.enabled = false;
            cameraScript.enabled = false;

            //if admin switch on AdminCamera script
            //AdminCamera admincamera = GameObject.Find ("Main Camera").GetComponent<AdminCamera>();
            //admincamera.enabled = true;

        }
        else
        {

            //if(playerRotationScript == null)
            //	playerRotationScript = transform.GetComponent<MouseCamera>();

            //playerRotationScript.enabled = false;

        }
    }
Exemplo n.º 4
0
 public void Start()
 {
     _pd            = FindObjectOfType <PlayerData>();
     _move          = _pd.gameObject.GetComponent <Movement>();
     _move.isLocked = true;
     _mc            = _move.gameObject.GetComponentInChildren <MouseCamera>();
     _mc.SetCursorNone();
 }
Exemplo n.º 5
0
        private void renderDisplay_OnInitialize(object sender, EventArgs e)
        {
            mGameTime    = new GameClock();
            mBasicEffect = new BasicEffect(GraphicsDevice);
            mCamera      = new MouseCamera(GraphicsDevice);

            Visible = false;
        }
 // Use this for initialization
 void Start()
 {
     PlayerBigScript  = PlayerBig.GetComponent <my_character_controller> ();
     PlayerSmolScript = PlayerSmol.GetComponent <my_character_controller> ();
     //PlayerBigController = PlayerBig.GetComponent<CharacterController> ();
     PlayerSmolController   = PlayerSmol.GetComponent <CharacterController> ();
     PlayerBigCameraScript  = PlayerBigCamera.GetComponent <MouseCamera> ();
     PlayerSmolCameraScript = PlayerSmolCamera.GetComponent <MouseCamera> ();
     anchorPos = PlayerBig.transform.position - PlayerSmol.transform.position;
 }
Exemplo n.º 7
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController    = GetComponent <CharacterController>();
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_StepCycle = 0f;
     m_NextStep  = m_StepCycle / 2f;
     m_Jumping   = false;
     m_MouseLook = new MouseCamera();
     m_MouseLook.Init(this.transform, m_Camera.transform);
 }
Exemplo n.º 8
0
    private void Start()
    {
        controller     = GetComponent <CharacterController>();
        raycastMaxDist = controller.bounds.extents.y;

        frozenObjects = new List <GameObject>();
        playerState   = PlayerState.Alive;

        gameManager = FindObjectOfType <GameManager>();
        playerCam   = GetComponentInChildren <MouseCamera>();
    }
Exemplo n.º 9
0
        private void Start()
        {
            _player     = GameObject.FindGameObjectWithTag("GameController");
            _viewCamera = UnityEngine.Camera.main;
            _mouseCam   = FindObjectOfType <MouseCamera>();
            if (Instance == null)
            {
                Instance = this;
            }

            _soundFolder = GameObject.FindGameObjectWithTag("SFX").GetComponent <SFX>();
        }
Exemplo n.º 10
0
 // Use this for initialization
 private void Start()
 {
     _mouseCamera = FindObjectOfType <MouseCamera>();
 }
Exemplo n.º 11
0
        void LoadCamera()
        {
            mouseCamera = new MouseCamera(this);

            mouseCamera.LoadContent();

            mouseCamera.cameraPosition = myLevel.cameraSpawn.Position;
            mouseCamera.leftrightRot = MathHelper.PiOver2;
        }
Exemplo n.º 12
0
    void Start()
    {

        //TODO: Bugfix to allow .isMine and .owner from AWAKE!


		if(GameObject.Find ("GameManager").GetComponent<GameManagerVik>().isTutorial)
		{

			Renderer[] rs =  this.transform.GetComponentsInChildren<Renderer>();
			foreach (Renderer r in rs)
				r.enabled = false;
			
			
			//Camera.main.transform.parent = transform;
			//Camera.main.transform.localPosition = cameraRelativePosition;
			//Camera.main.transform.localEulerAngles = new Vector3(0.6651921f, 90, 0);
			
			if(cameraScript == null)
				cameraScript = GameObject.Find ("Main Camera").GetComponent<MouseCamera>();
			if(playerRotationScript == null)
				playerRotationScript = transform.GetComponent<MouseCamera>();
			
			
			playerRotationScript.enabled = true;
			cameraScript.enabled = true;
			
			gameObject.GetComponent<ClickMove>().enabled = true;
			gameObject.GetComponent<CharacterMotor>().enabled = true;
			gameObject.GetComponent<DetectObjects>().enabled = true;			


		}


		else if (photonView.isMine )
        {
            //MINE: local player, simply enable the local scripts


				

           // controllerScript.enabled = true;
			Renderer[] rs =  this.transform.GetComponentsInChildren<Renderer>();
			foreach (Renderer r in rs)
				r.enabled = false;


			//Camera.main.transform.parent = transform;
			//Camera.main.transform.localPosition = cameraRelativePosition;
			//Camera.main.transform.localEulerAngles = new Vector3(0.6651921f, 90, 0);

			if(cameraScript == null)
				cameraScript = GameObject.Find ("Main Camera").GetComponent<MouseCamera>();
			if(playerRotationScript == null)
				playerRotationScript = transform.GetComponent<MouseCamera>();


			playerRotationScript.enabled = true;
			cameraScript.enabled = true;
			
			gameObject.GetComponent<ClickMove>().enabled = true;
			gameObject.GetComponent<CharacterMotor>().enabled = true;
//			gameObject.GetComponent<DetectObjects>().enabled = true;
			
        }
        else
        {           



			if(playerRotationScript == null)
				playerRotationScript = transform.GetComponent<MouseCamera>();

			Renderer[] rs =  this.transform.GetComponentsInChildren<Renderer>();
			foreach (Renderer r in rs)
				r.enabled = true;
			playerRotationScript.enabled = false;
			gameObject.GetComponent<ClickMove>().enabled = false;
			gameObject.GetComponent<CharacterMotor>().enabled = false;
		//	gameObject.GetComponent<DetectObjects>().enabled = false;
			gameObject.GetComponent<Selector>().enabled = false;
          //  controllerScript.enabled = true;

        }

		//gameObject.GetComponent<ClickMove>().SendMessage("SetIsRemotePlayer", !photonView.isMine);
	


    

       
    }