Пример #1
0
    public void DisplayAchievement(string achievement)
    {
        GameObject achievementsObject        = GameObject.Find("Achievements");
        ToastAchievementFillerScript content = achievementsObject.GetComponent <ToastAchievementFillerScript>();
        GameObject prefabValue = GameObject.Instantiate(content.prefabToInstantiate) as GameObject;

        prefabValue.GetComponentInChildren <Text>().text = achievement;
        content.AddFillerObject(prefabValue);
        MyExtensionMethods.InitAudio(ref achievementSound, StringNamesInfo.ACHIEVEMENT_SOUND);
        if (achievementSound && SettingsScript.EffectVolume > 0.01f)
        {
            achievementSound.Play();
        }
    }
Пример #2
0
 void Start()
 {
     MyExtensionMethods.InitAudio(ref shootSound, StringNamesInfo.FIRE_SOUND);
     MyExtensionMethods.InitAudio(ref deniedSound, StringNamesInfo.DENIED_SOUND);
     if (!whatToControll)
     {
         return;
     }
     #region CACHE_COMPONENTS
     controllGun   = whatToControll.GetComponent <BuildGunScript>().ControllGunSystem;
     controllShoot = whatToControll.GetComponent <BuildGunScript>().ShootSystem;
     #endregion
     Slider rotateController = GameObject.Find(StringNamesInfo.ROTATEGUNCONTROLLER_name).GetComponent <Slider>();
     rotateController.value    = 90.0f;
     rotateController.minValue = controllGun.MinAngle;
     rotateController.maxValue = controllGun.MaxAngle;
     rotateController.onValueChanged.AddListener(delegate { controllGun.RotateGun(rotateController.value); });
     StartCoroutine(LateStart());
 }
Пример #3
0
 void Start()
 {
     MyExtensionMethods.InitAudio(ref restoreAmmoSound, StringNamesInfo.AMMO_SOUND);
 }
Пример #4
0
 void Awake()
 {
     MyExtensionMethods.InitAudio(ref meteorSoundExplodeInAir, StringNamesInfo.METEOR_IN_AIR_EXPLOSION_SOUND);
     MyExtensionMethods.InitAudio(ref meteorSoundExplodeOnGround, StringNamesInfo.METEOR_ON_GROUND_EXPLOSION_SOUND);
     MyExtensionMethods.InitAudio(ref coinSound, StringNamesInfo.COIN_SOUND);
 }