示例#1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            Instantiate(explosion, transform.position, transform.rotation);
            Destroy(gameObject);
            if (isMultiplier)
            {
                assignedGameController.gamecontroller.IncreaseMultiplier();
            }
            if (isUpgrade)
            {
                shotSpawnLocation.x = PlayerObject.transform.position.x - 0.66f;
                shotSpawnLocation.y = 0.0f;
                shotSpawnLocation.z = PlayerObject.transform.position.z - 0.2f;
                GameObject go = Instantiate(doubleShotControl1, shotSpawnLocation, Quaternion.identity) as GameObject;
                go.transform.parent         = PlayerObject.transform;
                doubleShotControl1Component = go.GetComponent <ShotControl> ();
                doubleShotControl1Component.SwitchSpawn(true);

                shotSpawnLocation.x = PlayerObject.transform.position.x + 0.66f;
                shotSpawnLocation.y = 0.0f;
                shotSpawnLocation.z = PlayerObject.transform.position.z - 0.2f;
                go = Instantiate(doubleShotControl2, shotSpawnLocation, Quaternion.identity) as GameObject;
                go.transform.parent         = PlayerObject.transform;
                doubleShotControl1Component = go.GetComponent <ShotControl> ();
                doubleShotControl1Component.SwitchSpawn(true);
            }
            assignedGameController.gamecontroller.addScore(scoreValue);
        }
    }
示例#2
0
 void Start()
 {
     timer     = 3.0f;
     collider  = GetComponent <Collider2D>();
     shotCtrl  = GetComponent <ShotControl>();
     rigidBody = GetComponent <Rigidbody2D>();
 }
示例#3
0
    void Awake()
    {
        shotControl = GetComponent<ShotControl>();
        vision = GetComponent<Vision>();

        camSpeed = camSpeedDefault;
        nextRotationChange = Time.time;
        nextXCheck = 0;
        angle = 0f;
    }
示例#4
0
    void Awake()
    {
        shotControl = GetComponent <ShotControl>();
        vision      = GetComponent <Vision>();

        camSpeed           = camSpeedDefault;
        nextRotationChange = Time.time;
        nextXCheck         = 0;
        angle = 0f;
    }
示例#5
0
    void Awake()
    {
        shotControl = GetComponent <ShotControl>();
        vision      = GetComponent <Vision>();

        state = SEARCHING;

        nextRotationChange = Time.time;
        nextXCheck         = 0;
        xRot = 0f;
    }
示例#6
0
    void Awake()
    {
        shotControl = GetComponent<ShotControl>();
        vision = GetComponent<Vision>();

        state = SEARCHING;

        nextRotationChange = Time.time;
        nextXCheck = 0;
        xRot = 0f;
    }
示例#7
0
        /// <summary>
        /// Стрельба по кораблям
        /// </summary>
        /// <param name="ship"></param>
        private void Shoot(SpaceShip ship)
        {
            var shot          = new Shot(ship, MapCenter);
            var newShotObject = new ShotControl(shot);

            Panel.SetZIndex(newShotObject, 20);
            Map.Children.Add(newShotObject);

            Canvas.SetTop(newShotObject, -1000);
            Canvas.SetLeft(newShotObject, -1000);

            _shotObjects[shot] = newShotObject;
        }
示例#8
0
    void Awake()
    {
        shotControl = GetComponent <ShotControl>();
        vision      = GetComponent <Vision>();

        state = SEARCHING;

        nextRotationChange = Time.time;
        nextXCheck         = 0;
        xRot = 0f;

        nextTargetMemory = new Dictionary <Position, Position>();
        previousTarget   = null;
        currentTarget    = null;
    }
示例#9
0
    void Awake()
    {
        shotControl = GetComponent<ShotControl>();
        vision = GetComponent<Vision>();

        state = SEARCHING;

        nextRotationChange = Time.time;
        nextXCheck = 0;
        xRot = 0f;

        nextTargetMemory = new Dictionary<Position, Position>();
        previousTarget = null;
        currentTarget = null;
    }
 void Start()
 {
     s = GetComponent<ShotControl>();
     Cursor.visible = false;
     Cursor.lockState = CursorLockMode.Locked;
 }
示例#11
0
 private void Awake()
 {
     shotControlInspec = shotControlObject.GetComponent <ShotControl>();
     gameController    = GameObject.FindWithTag("gameCon").GetComponent <GameController>();
 }
示例#12
0
 void Start()
 {
     s = GetComponent <ShotControl>();
     Cursor.visible   = false;
     Cursor.lockState = CursorLockMode.Locked;
 }
示例#13
0
 void Awake()
 {
     clientObject      = GameObject.FindWithTag("Server");
     shotControlInspec = shotControl.GetComponent <ShotControl>();
     client            = clientObject.GetComponent <TCPServer>();
 }