示例#1
0
 // Use this for initialization
 void Start()
 {
     _input     = GameObject.Find("GameController").GetComponent <InputHandler> ();
     _health    = GetComponent <HealthHandler> ();
     _move      = GetComponent <MovementHandler> ();
     _shoot     = GetComponent <ShootHandler> ();
     _collision = GetComponent <CollisionHandler> ();
 }
示例#2
0
    override protected void Start()
    {
        _shootHandler = gameObject.GetComponentInChildren <ShootHandler>();
        _lifeHandler  = gameObject.GetComponent <ShipLifeHandler>();

        MaxSpeed           = MAX_SPEED; //speed we can reach in 1 sec
        RotSpeed           = ROT_SPEED; //speed we can turn in 1 sec
        ShipBoundaryRadius = BOUNDARY_RADIUS;

        _lifeHandler.Health = HEALTH;
        _shootHandler.DamageDealtModifier = DAMAGE_DEALT_MODIFIER;
    }
示例#3
0
    override protected void Start()
    {
        _shootHandler = gameObject.GetComponentInChildren <ShootHandler>();
        _lifeHandler  = gameObject.GetComponent <ShipLifeHandler>();

        MaxSpeed           = MAX_SPEED; //speed we can reach in 1 sec
        RotSpeed           = ROT_SPEED; //speed we can turn in 1 sec
        ShipBoundaryRadius = BOUNDARY_RADIUS;

        ResetHealth();
        _shootHandler.DamageDealtModifier = DAMAGE_DEALT_MODIFIER;
        _shootHandler.PlayerLayer         = this.gameObject.layer;


        NetworkServerUI.SendHealthInfo((gameObject.layer - Constants.LAYER_OFFSET) + 1, HEALTH, true);
    }
示例#4
0
        private static void Server_OnRequestReceived(NetPeer peer, byte[] data, string networkID)
        {
            ClientController client = null;

            lock (ClientsLock) {
                client = ClientControllers.Find(x => x.Peer == peer);
            }

            if (client == null)
            {
                return;
            }

            NetDataRequest ndata = Utils.FromBytesJSON <NetDataRequest>(data);

            if (string.IsNullOrEmpty(client.Client.Nickname))
            {
                switch (ndata.Type)
                {
                case RequestTypes.Login: LoginHandler.DoHandle(ndata, client, networkID); break;
                }
            }
            else
            {
                switch (ndata.Type)
                {
                case RequestTypes.EnterInMission: EnterInMissionHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.SyncPlayer: SyncPlayerHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.Shoot: ShootHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.GetRooms: GetRoomsHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.CreateRoom: CreateRoomHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.EnterInRoom: EnterInRoomHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.StartMission: StartMissionHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.LeaveRoom: LeaveRoomHandler.DoHandle(ndata, client, networkID); break;

                case RequestTypes.SyncRoom: ProjectKillersServer.RequestHandlers.SyncRoomHandler.DoHandle(ndata, client, networkID); break;
                }
            }
        }
 // Use this for initialization
 void Start()
 {
     _shootHandler = GetComponent<ShootHandler>();
     ship = GetComponentInParent<Ship>();
     shipName = ship.name;
 }
示例#6
0
 private void Start()
 {
     _shootHandler   = FindObjectOfType <ShootHandler>();
     speedText.text  = _shootHandler.gravity.ToString();
     heightText.text = _shootHandler.firingAngle.ToString();
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     _animator = GetComponent <Animator> ();
     _shoot    = GetComponentInParent <ShootHandler> ();
 }