void Start() { isAlive = true; player = gameObject; fireRate = 0.3f; armeSelected = ArmeEnum.LanceBoulette; armureSelected = ArmureEnum.Aucune; dir = new Vector3(1, 0); v = 5; a = 70; transform.FindChild("ArmureBois_A").active = false; transform.FindChild("ArmureCartonl_A").active = false; transform.FindChild("GunAPattate_W").active = false; transform.FindChild("catapulte_a_petard_W").active = false; transform.FindChild("SlingShoot_a_OeufPourris_W").active = false; //rotations : x,z,y transform.Rotate(new Vector3(1, 0, 0), 90); //transform.Rotate(new Vector3(0, 1, 0), 180); transform.Rotate(new Vector3(0, 0, 1), 180); lastAngl = 90; }
public void changementDArme() { // Boulette papier if (Input.GetKeyDown("a") || Input.GetKeyDown("q")) { armeSelected = ArmeEnum.LanceBoulette; transform.FindChild("ArmeDeBase_W").active = true; transform.FindChild("GunAPattate_W").active = false; transform.FindChild("SlingShoot_a_OeufPourris_W").active = false; transform.FindChild("catapulte_a_petard_W").active = false; } // Patate if (Input.GetKeyDown("w") || Input.GetKeyDown("z")) { if (GameStateManager.Instance.isPossessed(ArmeEnum.LancePatate)) { armeSelected = ArmeEnum.LancePatate; transform.FindChild("ArmeDeBase_W").active = false; transform.FindChild("GunAPattate_W").active = true; transform.FindChild("SlingShoot_a_OeufPourris_W").active = false; transform.FindChild("catapulte_a_petard_W").active = false; } } // Oeuf if (Input.GetKeyDown("e")) { if (GameStateManager.Instance.isPossessed(ArmeEnum.LanceOeuf)) { armeSelected = ArmeEnum.LanceOeuf; transform.FindChild("ArmeDeBase_W").active = false; transform.FindChild("GunAPattate_W").active = false; transform.FindChild("SlingShoot_a_OeufPourris_W").active = true; transform.FindChild("catapulte_a_petard_W").active = false; } } // Pétard if (Input.GetKeyDown("r")) { if (GameStateManager.Instance.isPossessed(ArmeEnum.LancePetard)) { armeSelected = ArmeEnum.LancePetard; transform.FindChild("ArmeDeBase_W").active = false; transform.FindChild("GunAPattate_W").active = false; transform.FindChild("SlingShoot_a_OeufPourris_W").active = false; transform.FindChild("catapulte_a_petard_W").active = true; } } }
public Texture2D getTexture2D(ArmeEnum a) { return(ArmeTx[a]); }
public bool isPossessed(ArmeEnum type) { return(isPossessedArme[type]); }
public void setPossessed(ArmeEnum a) { isPossessedArme[a] = true; }