예제 #1
0
    // Use this for initialization
    void Start()
    {
        mb     = FindObjectOfType <MusclesBehavior>();
        gb     = FindObjectOfType <GunBehavior>();
        mjoint = GetComponent <SpringJoint2D>();
        gjoint = GetComponent <SpringJoint2D>();

        mjoint.connectedBody = mb.rb2;
        gjoint.connectedBody = gb.rb2;
    }
예제 #2
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        gb = FindObjectOfType <GunBehavior>();
        mb = FindObjectOfType <MusclesBehavior>();

        leftFoot  = transform.Find("leftFloor").GetComponent <footScript>();
        rightFoot = transform.Find("rightFloor").GetComponent <footScript>();
    }
예제 #3
0
 public override void Start()
 {
     base.Start();
     gun       = FindObjectOfType <GunBehavior>();
     grabPoint = transform.Find("grabPoint");
     leftFoot  = transform.Find("leftFloor").GetComponent <footScript>();
     rightFoot = transform.Find("rightFloor").GetComponent <footScript>();
     jumpLeft  = transform.Find("jumpLeft").GetComponent <footScript>();
     jumpRight = transform.Find("jumpRight").GetComponent <footScript>();
 }
예제 #4
0
 public void Setup()
 {
     guns = new List <GunBehavior>(FindObjectsOfType <GunBehavior>());
     if (guns.Count == 0)
     {
         throw new Exception("Theres no gun in scene!");
     }
     currentGun = guns[0];
     gunIndex   = 0;
     currentGun.planet.Select(true);
 }
예제 #5
0
    public static void LostGun(GunBehavior gun)
    {
        Instance.lostingGun = true;
        int i = Instance.guns.LastIndexOf(gun);

        if (i == Instance.gunIndex)
        {
            GunController.SwitchPlanet(0);
        }
        Instance.guns.Remove(gun);
        Instance.lostingGun = false;
    }
예제 #6
0
 // Start is called before the first frame update
 void Start()
 {
     try
     {
         equippedGun = GetComponentInChildren <GunBehavior>();
         fullAuto    = equippedGun.fullAuto;
     }
     catch
     {
         Debug.Log("No gun found");
         Destroy(this);
     }
     playerBase    = GetComponent <PlayerBase>();
     supplyManager = GetComponent <PlayerSupplyManager>();
 }
    // Update is called once per frame
    void Update()
    {
        GameSceneUIController.HP = players.hp / players.maxHP;
        GunBehavior gb_A = wSel.weaponA.GetComponent <GunBehavior>();
        GunBehavior gb_B = wSel.weaponA.GetComponent <GunBehavior>();

        if (gb_A != null)
        {
            GameSceneUIController.Weapon0.enable       = true;
            GameSceneUIController.Weapon0.icon         = gb_A.icon;
            GameSceneUIController.Weapon0.weaponName   = gb_A.WeaponName;
            GameSceneUIController.Weapon0.weaponNumber = 0;
            GameSceneUIController.Weapon0.reload       = gb_A.ReloadingF;
            GameSceneUIController.Weapon0.now          = gb_A.Loaded.now;
            GameSceneUIController.Weapon0.max          = gb_A.Spare.now;
        }
    }
예제 #8
0
    public void onDeath()
    {
        GunBehavior     ngb = GetComponent <GunBehavior>();
        MusclesBehavior nmb = GetComponent <MusclesBehavior>();

        audioManager.playClipHere("explode", transform.position);
        if (ngb == null && nmb == null)
        {
            Destroy(gameObject);
        }
        else if (nmb != null)
        {
            nmb.remoteDrop();
            nmb.transform.position = new Vector2(-100, -100); //just move him elsewhere...
        }
        else if (ngb != null)
        {
            string current = SceneManager.GetActiveScene().name;
            SceneManager.LoadScene(current);
        }
    }
예제 #9
0
 void Awake()
 {
     myGun      = GetComponentInChildren <GunBehavior>();
     m_Animator = GetComponent <Animator>();
 }
예제 #10
0
 // Start is called before the first frame update
 void Start()
 {
     equippedGun = GetComponentInChildren <GunBehavior>();
 }