Example #1
0
    void Start() {
        if (gameObject.transform.FindChild("Turrent"))
        {
            turret = gameObject.transform.FindChild("Turrent").gameObject;
        }
        gunnerScript = GetComponent<GunnerController>();
        if (gunnerScript)
        {
            gturretrotation = gunnerScript.transform.rotation;
        }
        var playerName = PhotonNetwork.player.name;
        if (photonView.isMine)
        {
            GetComponent<ClientSync>().enabled = true;
            myCamera.SetActive(true);
            gameObject.name = playerName;

            if (playerName == "driver")
            {
                GetComponent<DriverController>().enabled = true;
            }
            if (playerName == "gunner")
            {
                GetComponent<GunnerController>().enabled = true;
            }
        }
        else
        {
			StartCoroutine("Alive");
        }
    }
    private void Start()
    {
        controller       = this.GetComponent <Controller2D>();
        enemyController  = this.GetComponent <EnemyController2D>();
        gunnerController = this.GetComponent <GunnerController>();

        stats        = this.GetComponent <StatManager>();
        charRenderer = this.GetComponent <SpriteRenderer>();
        animator     = this.GetComponent <Animator>();
    }
Example #3
0
        public PlayerRotatingGun(Ship parent, Vector2 positionRelativeToParent, float directionRelativeToParent, GunnerController controller)
            : base(parent, positionRelativeToParent, directionRelativeToParent, (float)(Math.PI * .5))
        {
            controller.Register(this);
            this.controller = controller;

            Gun gun1 = new Gun(this, new Vector2(50f, 10), 0);

            GameObject.Collection.Add(gun1);
            Gun gun2 = new Gun(this, new Vector2(50f, -10), 0);

            GameObject.Collection.Add(gun2);
        }
Example #4
0
 public GunnerDead(Transform gunner)
 {
     this.gunner = gunner.GetComponent<GunnerController>();
 }
Example #5
0
 public GunnerDead(Transform gunner)
 {
     this.gunner = gunner.GetComponent <GunnerController>();
 }
Example #6
0
 public GunnerAttackingPlayer(Transform gunner)
 {
     this.gunner = gunner.GetComponent <GunnerController>();
 }
Example #7
0
 public GunnerInFormation(Transform gunner)
 {
     this.gunner = gunner.GetComponent <GunnerController>();
 }
Example #8
0
 public GunnerMovingToPosition(Transform gunner)
 {
     this.gunner = gunner.GetComponent <GunnerController>();
 }
Example #9
0
 public GunnerInFormation(Transform gunner)
 {
     this.gunner = gunner.GetComponent<GunnerController>();
 }
Example #10
0
 public GunnerMovingToPosition(Transform gunner)
 {
     this.gunner = gunner.GetComponent<GunnerController>();
 }
        public override void Execute(EnemyController enemyController)
        {
            GunnerController gunnerController = (GunnerController)enemyController;

            gunnerController.shootPlayer();
        }
Example #12
0
 public GunnerReachedScreenEdge(Transform gunner)
 {
     this.gunner = gunner.GetComponent <GunnerController>();
     randomPos   = Vector3.zero;
 }
Example #13
0
 public GunnerAttackingPlayer(Transform gunner)
 {
     this.gunner = gunner.GetComponent<GunnerController>();
 }
Example #14
0
 public GunnerReachedScreenEdge(Transform gunner)
 {
     this.gunner = gunner.GetComponent<GunnerController>();
     randomPos = Vector3.zero;
 }