예제 #1
0
파일: Bird.cs 프로젝트: pdxparrot/ggj2018
        public void Initialize(Player owner, BirdTypeData birdType)
        {
            Owner = owner;
            Type  = birdType;

            gameObject.layer = Type.PlayerLayer;

            foreach (Renderer r in _coloredRenderers)
            {
                r.material.SetColor(PlayerManager.Instance.PlayerData.PlayerColorProperty, Owner.PlayerColor);
            }
        }
예제 #2
0
파일: Player.cs 프로젝트: pdxparrot/ggj2018
        private void Initialize(int id, Bird bird, BirdTypeData birdType)
        {
            Initialize(id);

            name = $"Player {Id}";
            Bird = bird;

            Bird.Initialize(this, birdType);
            Controller.Initialize(this);
            State.Initialize();

            _godRay = Instantiate(PlayerManager.Instance.PlayerGodRayPrefab, transform);
            _godRay.SetupPlayer(this);

            LogInfo();
        }
예제 #3
0
 public override bool ShowScore(BirdTypeData birdType)
 {
     return(birdType.IsPredator);
 }
예제 #4
0
 public override int ScoreLimit(BirdTypeData birdType)
 {
     return(birdType.IsPredator ? PlayerManager.Instance.Prey.Count : 1);
 }
예제 #5
0
 public override bool ShowScore(BirdTypeData birdType)
 {
     return(true);
 }
예제 #6
0
 public override int ScoreLimit(BirdTypeData birdType)
 {
     return(GameTypeData.ScoreLimit);
 }
예제 #7
0
 public abstract bool ShowScore(BirdTypeData birdType);
예제 #8
0
 public abstract int ScoreLimit(BirdTypeData birdType);
예제 #9
0
 public void SetVision(BirdTypeData birdType)
 {
     _predatorVision.Enabled = birdType.IsPredator;
 }
예제 #10
0
 public SpawnPoint GetSpawnPoint(BirdTypeData birdType)
 {
     return(birdType.IsPredator
         ? GetPredatorSpawnPoint(GameManager.Instance.GameType)
         : GetPreySpawnPoint(GameManager.Instance.GameType));
 }
예제 #11
0
        public SpawnPoint GetSpawnPoint(GameTypeData gameTypeData, BirdTypeData birdType)
        {
            SpawnPoints spawnPoints = _spawnPoints.GetOrDefault(gameTypeData);

            return(spawnPoints?.GetSpawnPoint(birdType));
        }
예제 #12
0
파일: Player.cs 프로젝트: pdxparrot/ggj2018
 public void InitializeNetwork(int id, Bird bird, BirdTypeData birdType)
 {
     Debug.Log($"Initializing network player {id}");
     Initialize(id, bird, birdType);
 }
예제 #13
0
파일: Player.cs 프로젝트: pdxparrot/ggj2018
        public void InitializeLocal(int id, int controllerIndex, Camera.Viewer viewer, Bird bird, BirdTypeData birdType)
        {
            Driver.ControllerIndex = controllerIndex;
            _viewer = viewer;

            Debug.Log($"Initializing local player {id}");
            Initialize(id, bird, birdType);

            Viewer.Initialize(this);

            Viewer.FollowCamera.SetTarget(this);

            // ouch.... why not just render everything except for OtherRenderLayer ?
            Viewer.AddRenderLayer(Bird.Type.PlayerLayer);
            Viewer.AddRenderLayer(Bird.Type.OtherPlayerLayer);
            Viewer.AddRenderLayer(Bird.Type.RenderLayer);
            Viewer.RemoveRenderLayer(Bird.Type.OtherRenderLayer);
            Viewer.AddRenderLayer(GameManager.Instance.ObstacleLayer);
        }
예제 #14
0
 public override int ScoreLimit(BirdTypeData birdType)
 {
     return(0);
 }