Inheritance: MonoBehaviour
コード例 #1
0
 private void Start()
 {
     Instance        = this;
     cam             = base.transform.GetChild(0).GetComponent <Camera>();
     cam.fieldOfView = GameState.Instance.fov;
     offset          = base.transform.position - player.transform.position;
 }
コード例 #2
0
 public void Start()
 {
     Registry.Islands.Add(Uid, this.gameObject);
     InitLineRender();
     Island         = GetComponent <IslandData>();
     cameraMovement = Camera.main.GetComponent <MoveCamera>();
 }
コード例 #3
0
    void Start()
    {
        controller = gameObject.GetComponent <CharacterController>();
        movement   = new Movement(gameObject, controller
                                  , _moveAcc: moveAcc, _moveMax: moveMax
                                  , _friction: moveFriction, _gravity: moveGravity)
        {
            isRetainMotionEnabled = true
        };

        movementProfileNormal = new MovementProfile(_moveAcc: moveAcc, _moveMax: moveMax
                                                    , _friction: moveFriction, _gravity: moveGravity, _isMoveEnabled: true
                                                    , _isFrictionEnabled: true, _isGravityEnabled: true, _isRetainMotionEnabled: false);

        movementProfileAirdash = new MovementProfile(_moveAcc: moveAccAirdash, _moveMax: moveMax
                                                     , _friction: moveFrictionAirdash, _gravity: moveGravity, _isRetainMotionEnabled: true);


        cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MoveCamera>();

        currentGun       = transform.Find("Main Camera/Handgun").gameObject;
        currentGunScript = currentGun.GetComponent <PlayerGun>();

        thisTransform = gameObject.transform;
    }
コード例 #4
0
        public void NotifyGameEnd(Nexus nexus)
        {
            var losingTeam = nexus.Team;

            foreach (var p in _playerManager.GetPlayers())
            {
                var coords = _game.Map.GetEndGameCameraPosition(losingTeam);
                var cam    = new MoveCamera(p.Item2.Champion, coords[0], coords[1], coords[2], 2);
                _game.PacketHandlerManager.sendPacket(p.Item2.Peer, cam, Channel.CHL_S2C);
                _game.PacketHandlerManager.sendPacket(p.Item2.Peer, new HideUi(), Channel.CHL_S2C);
            }
            _game.PacketHandlerManager.broadcastPacket(new ExplodeNexus(nexus), Channel.CHL_S2C);

            var timer = new System.Timers.Timer(5000);

            timer.AutoReset = false;
            timer.Elapsed  += (a, b) =>
            {
                var win = new GameEnd(true);
                _game.PacketHandlerManager.broadcastPacketTeam(CustomConvert.getEnemyTeam(losingTeam), win, Channel.CHL_S2C);
                var lose = new GameEnd(false);
                _game.PacketHandlerManager.broadcastPacketTeam(losingTeam, lose, Channel.CHL_S2C);
            };
            timer.Start();
        }
コード例 #5
0
 void OnCollisionEnter2D(Collision2D hit)
 {
     if (hit.collider.CompareTag(tagCollider))
     {
         MoveCamera.SetTarget(target, timeToFollow, velocityToTarget);
     }
 }
コード例 #6
0
 void OnTriggerEnter2D(Collider2D hit)
 {
     if (hit.CompareTag(tagCollider))
     {
         MoveCamera.SetTarget(target, timeToFollow, velocityToTarget);
     }
 }
コード例 #7
0
    public void Start()
    {
        DontDestroyOnLoad(this);
        if (instance == null)
        {
            instance = this;
            Debug.Log("This is level " + level);

            moveCamera   = FindObjectOfType <MoveCamera>();
            audioManager = FindObjectOfType <AudioManager>();

            audioManager.soundTrack(musicTrack.gameSound);
            audioManager.ambianceSoundTrack(environmentalSound.ambience);

            player1 = SwapManager.instance.objPlayer1;
            player2 = SwapManager.instance.objPlayer2;

            GetStartPositions();
        }
        else
        {
            Destroy(this.gameObject);
            Debug.LogError("More than one levelmanager in scene.");
        }
    }
コード例 #8
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            Debug.Log("1");
            // Init MoveCamera location
            MoveCamera moveCamera = GetComponent <MoveCamera>();
            moveCamera.UpdateLocation("espoo");
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            Debug.Log("2");
            // Init MoveCamera location
            MoveCamera moveCamera = GetComponent <MoveCamera>();
            moveCamera.UpdateLocation("church");
        }

        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            Debug.Log("3");
            // Init MoveCamera location
            MoveCamera moveCamera = GetComponent <MoveCamera>();
            moveCamera.UpdateLocation("suomenlinna");
        }

        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            Debug.Log("4");
            // Init MoveCamera location
            MoveCamera moveCamera = GetComponent <MoveCamera>();
            moveCamera.UpdateLocation("fjord");
        }
    }
コード例 #9
0
 private void Start()
 {
     firstY = 10f;
     SetOrthographicSize();
     SetResoultion(screenWidth, screenHeight, IsFullScreen);
     moveCamera = new MoveCamera(MouseMode);
 }
コード例 #10
0
ファイル: PacketNotifier.cs プロジェクト: agentran/GameServer
        public void NotifyGameEnd(Vector3 cameraPosition, INexus nexus, List <Pair <uint, ClientInfo> > players)
        {
            var losingTeam = nexus.Team;

            foreach (var p in players)
            {
                var cam = new MoveCamera(p.Item2.Champion, cameraPosition.X, cameraPosition.Y, cameraPosition.Z, 2);
                _packetHandlerManager.SendPacket((int)p.Item2.UserId, cam, Channel.CHL_S2C);
                _packetHandlerManager.SendPacket((int)p.Item2.UserId, new HideUi(), Channel.CHL_S2C);
            }

            _packetHandlerManager.BroadcastPacket(new ExplodeNexus(nexus), Channel.CHL_S2C);

            var timer = new Timer(5000)
            {
                AutoReset = false
            };

            timer.Elapsed += (a, b) =>
            {
                var gameEndPacket = new GameEnd(losingTeam != TeamId.TEAM_BLUE);
                _packetHandlerManager.BroadcastPacket(gameEndPacket, Channel.CHL_S2C);
            };
            timer.Start();
        }
コード例 #11
0
ファイル: MoveCamera.cs プロジェクト: ponlawat30109/203_Final
    void Start()
    {
        instance = this;

        camPos = _cam.transform.position;
        Debug.Log(camPos);
    }
コード例 #12
0
        public void NotifyGameEnd(Nexus nexus)
        {
            var losingTeam = nexus.Team;

            foreach (var p in _playerManager.GetPlayers())
            {
                var coords = _game.Map.GetEndGameCameraPosition(losingTeam);
                var cam    = new MoveCamera(p.Item2.Champion, coords[0], coords[1], coords[2], 2);
                _game.PacketHandlerManager.sendPacket(p.Item2.Peer, cam, Channel.CHL_S2C);
                _game.PacketHandlerManager.sendPacket(p.Item2.Peer, new HideUi(), Channel.CHL_S2C);
            }

            _game.PacketHandlerManager.broadcastPacket(new ExplodeNexus(nexus), Channel.CHL_S2C);

            var timer = new System.Timers.Timer(5000)
            {
                AutoReset = false
            };

            timer.Elapsed += (a, b) =>
            {
                var gameEndPacket = new GameEnd(losingTeam != TeamId.TEAM_BLUE);
                _game.PacketHandlerManager.broadcastPacket(gameEndPacket, Channel.CHL_S2C);
            };
            timer.Start();
            Program.SetToExit();
        }
コード例 #13
0
ファイル: Inventory.cs プロジェクト: Geetchopra/21Days
    /// <summary>
    /// Set the active state of the items in use and enable the cursor.
    /// </summary>
    /// <param name="displayState"> The boolean parameter to set the display state to. </param>
    void SetActiveUI(bool displayState)
    {
        foreach (ThrowableManager throwable in throwables)
        {
            throwable.SetButtonActive(displayState);
        }

        foreach (KeyManager key in keys)
        {
            key.SetImageActive(displayState);
        }

        //Enable the cursor.
        Cursor.visible = displayState;

        //If inventory is visible, disable camera input and vice versa.
        if (displayState)
        {
            Cursor.lockState = CursorLockMode.None;
            MoveCamera.DisableInput();
            Time.timeScale = 0f;
        }
        else
        {
            Cursor.lockState = CursorLockMode.Locked;
            MoveCamera.EnableInput();
            Time.timeScale = 1f;
        }
    }
コード例 #14
0
	void Awake()
	{
		if (instance == null)
			instance = this;
		else if (instance != this)
			Destroy (this);
	}
コード例 #15
0
 void Start()
 {
     if (isEncubadora)
     {
         MoveCamera.SetTarget(transform, 10f, 10f);
     }
 }
コード例 #16
0
        public void Move(MoveCamera move)
        {
            _returnToSender = move.Return;
            _returnSpeed    = move.ReturnSpeed;

            _positions.AddRange(move.Position);
        }
コード例 #17
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #18
0
ファイル: MoveCamera.cs プロジェクト: rlaxodud214/VR_Contents
 void Awake()                                               // Start()보다 먼저 실행
 {
     Screen.SetResolution(1440, 1660, false);
     _Instance = GetComponent <MoveCamera>();    // _sceneManager변수에 자신의 SceneChangeManager 컴포넌트를 넣는다.
     x         = -5.5f;
     y         = -2f;
     z         = 12f;
 }
コード例 #19
0
 public static MoveCamera GetInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <MoveCamera>();
     }
     return(instance);
 }
コード例 #20
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "EndOfScene")
     {
         Debug.Log("TriggerEnter");
         MoveCamera.GetInstance().CameraCanMove = false;
     }
 }
コード例 #21
0
 private void GetColourStuff()
 {
     rend       = GetComponent <SpriteRenderer>();
     moveCamera = FindObjectOfType <MoveCamera>();
     Color c = rend.material.color;
     //c.a = 0f;
     //rend.material.color = c;
 }
コード例 #22
0
 void Start()
 {
     rgb2             = this.GetComponent <Rigidbody2D>();
     healthController = GameObject.FindWithTag(MyConst.PlayerBody).GetComponent <HealthController>();
     playAnimation    = GetComponentInChildren <PlayAnimation>();
     cam = GetComponentInChildren <MoveCamera>();//  GameObject.FindWithTag("MainCamera").GetComponent<MoveCamera>();
     SetStartVariables();
 }
コード例 #23
0
 void Start()
 {
     moveCamera    = FindObjectOfType <MoveCamera>();
     player        = FindObjectOfType <PlayerController>();
     betweenBattle = FindObjectOfType <BetweenBattle>();
     showMap       = FindObjectOfType <ShowMap>();
     rooms         = player.rooms;
 }
コード例 #24
0
 private void Start()
 {
     m_Camera     = Camera.main.transform;
     m_CameraMove = m_Camera.GetComponent <MoveCamera>();
     bar          = gameObject.GetComponent <Scrollbar>();
     bar.value    = 0.7f;
     StartCoroutine("ScrollRoutine");
 }
コード例 #25
0
 void Start()
 {
     pausePos   = new Vector3(0, 500, 0);
     savedXPos  = 0;
     savedYPos  = 8;
     savedZPos  = 0;
     cameraMain = GetComponent <MoveCamera>();
 }
コード例 #26
0
 // Use this for initialization
 void Start()
 {
     speedEnum = Speed.faster;
     startSpeed = speed;
     startVector = transform.position;
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
     moveCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<MoveCamera>();
 }
コード例 #27
0
ファイル: PlayerController.cs プロジェクト: Vermid/Funsdorf
 void GetComponents()
 {
     rgb2             = GetComponent <Rigidbody2D>();
     healthController = GameObject.FindWithTag(MyConst.PlayerBody).GetComponent <HealthController>();
     cam = GetComponentInChildren <MoveCamera>();//  GameObject.FindWithTag("MainCamera").GetComponent<MoveCamera>();
     specialAbilities = GetComponent <SpecialAbilities>();
     weaponScript     = GetComponentInChildren <WeaponScript>();
     anim             = GetComponent <Animator>();
 }
コード例 #28
0
 // Use this for initialization
 void Start()
 {
     mm       = GameObject.FindObjectOfType <ObjectSelector>();
     mc       = GameObject.FindObjectOfType <MoveCamera>();
     camObj   = GameObject.Find("Main Camera");
     cam      = mc.GetComponent <Camera>();
     mo       = GameObject.Find("MouseOver");
     selector = GameObject.Find("Selector");
 }
コード例 #29
0
 // Use this for initialization
 void Start()
 {
     app           = AppController.instance;
     invItemScript = gameObject.GetComponent <InventoryItem> ();
     moveCamScript = Camera.main.gameObject.GetComponent <MoveCamera> ();
     //moveDirection = rigidbody.transform.rotation.eulerAngles;
     messageRect       = new Rect(Screen.width / 2 + 300, Screen.height / 2 - 20, 200, 80);
     targetFlyRotation = rigidbody.transform.rotation.eulerAngles;
 }
コード例 #30
0
    void Start()
    {
        inControls = false;
        optionsPos = new Vector3(512, 384, -100);
        mainPos    = new Vector3(0, 0, -10);
        exitPos    = new Vector3(512, -384, -100);
        controlPos = new Vector3(-512, 384, -100);

        cameraMain = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MoveCamera>();
    }
コード例 #31
0
 // Use this for initialization
 void Start()
 {
     mc = GameObject.Find("MathiusEarthCam").GetComponent("MoveCamera")as MoveCamera;
     ps = GameObject.Find("MathiusEarthCam").GetComponent("PaulScore") as PaulScore;
     camera = GameObject.Find("MathiusEarthCam") as GameObject;
     mathius_cam = camera.GetComponent(typeof(Camera)) as Camera;
     delta = new Vector3(0.0f,0.0f,0.0f);
     anchor = new Vector3(0.0f,0.0f,0.0f);
     mathius = gameObject;
 }
コード例 #32
0
ファイル: MoveCamera.cs プロジェクト: AlexeiAj/Game3D
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;
    }
コード例 #33
0
 void Start()
 {
     moveCam = FindObjectOfType <MoveCamera>();
     bubbles[0].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     bubbles[1].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     bubbles[2].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     bubbles[3].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     bubbles[4].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     bubbles[5].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
 }
コード例 #34
0
ファイル: GameManager.cs プロジェクト: leon196/Sarcophagus
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        cameraScript = GetComponent<MoveCamera>();
        soundScript = myCamera.GetComponent<SoundManager>();
        zapScript = myCamera.GetComponent<EffectZapping>();
        videoPlayer = FindObjectOfType<VideoPlayer>();
    }
コード例 #35
0
 // Use this for initialization
 void Start()
 {
     this.cam = GetComponent<MoveCamera>();
 }
コード例 #36
0
ファイル: UICountdown.cs プロジェクト: BenDy557/TheFall
	// Use this for initialization
	void Start () {
		m_CameraScript =Camera.main.GetComponent<MoveCamera>();
		m_CameraScript.enabled = false;
		StartCoroutine (CountDown ());
	}
コード例 #37
0
        public LevelCompleteState(Serpents serpents)
        {
            _serpents = serpents;

            _homingDevice = new HomingDevice(_serpents);
            _serpents.PlayerSerpent.DirectionTaker = this;

            Vector3 toPosition, toLookAt;
            _serpents.PlayingField.GetCameraPositionForLookingAtPlayerCave(out toPosition, out toLookAt);

            _moveCamera = new MoveCamera(
                _serpents.Camera,
                4.5f.UnitsPerSecond(),
                toPosition,
                () => _serpents.PlayerSerpent.LookAtPosition);

            _serpents.PlayerCave.OpenDoor = true;

            // wait until serpent is in cave, then give length bonus
            _todo.AddOneShot(() => _homeIsNearCaveEntrance = true);
            _todo.AddWhile(time => !_serpentIsHome);
            _todo.AddOneShot(() =>
            {
                _serpents.PlayerSerpent.IsPregnant = false;
                _haltSerpents = true;
            });
            for (var i = 0; i < _serpents.PlayerSerpent.Length; i++)
                _todo.AddOneShot(1, () =>
                {
                    var tailSegement = _serpents.PlayerSerpent.RemoveTailWhenLevelComplete();
                    if (tailSegement != null)
                        _serpents.AddAndShowScore(500, tailSegement.Position);
                });

            // wait until all bonus texts gone
            _todo.AddWhile(time => _serpents.FloatingTexts.Items.Any());
            _todo.AddOneShot(() =>
            {
                _serpentIsHome = false;
                _haltSerpents = false;
                _homeIsNearCaveEntrance = false;
            });
            //_todo.AddWhile(time => !_serpentIsHome);

            _todo.AddOneShot(() =>
            {
                if (_serpents.PlayerEgg == null)
                {
                    _haltSerpents = false;
                    return;
                }
                _bonusLives = 1;
                _serpents.PlayerSerpent.DirectionTaker = null;
                var playerEggPosition = _serpents.PlayerEgg.Position;
                _moveCamera = new MoveCamera(_serpents.Camera, 2f.Time(), toPosition, () => playerEggPosition);
                // wait two sec (for camera) and then drive the baby home
                _todo.InsertNext(
                    time => time < 2,
                    time =>
                    {
                        _serpents.PlayerSerpent.Restart(_serpents.PlayingField, 0, _serpents.PlayerEgg.Whereabouts);
                        _serpents.PlayerEgg = null;
                        _serpents.PlayerSerpent.DirectionTaker = this;
                        _haltSerpents = false;
                        _serpentIsHome = false;
                        return false;
                    });
            });

            // make sure the camera aims at a serpent (the original or the new born baby)
            _todo.AddOneShot(() =>
            {
                _moveCamera = new MoveCamera(_serpents.Camera, 1f.Time(), toPosition, () => _serpents.PlayerSerpent.LookAtPosition);
            });

            _todo.AddWhile(time => (!_serpentIsHome || _serpents.FloatingTexts.Items.Any()) && time < 10);
        }
コード例 #38
0
 // Use this for initialization
 void Start()
 {
     correct = 0;
     streak_mode = false;
     streak_score = 0;
     lives = 5;
     mathius_variable = (int)Mathf.Floor(Random.Range(0, 9));
     num_correct = 0;
     num_wrong = 0;
     equation = "";
     moveCamera = GameObject.Find("MathiusEarthCam").GetComponent("MoveCamera") as MoveCamera;
 }