예제 #1
0
    private SpringJoint2D _spring; // The spring joint that will hold the projectile inside the specified radius

    #endregion Fields

    #region Methods

    /// <summary>
    /// Called when this object is active in the physics simulation
    /// </summary>
    void Awake()
    {
        // Get the catapult transform as soon as the physics simulation for this object starts
        _spring = GetComponent <SpringJoint2D> ();
        _catapult = _spring.connectedBody.transform;
        _sounds = GameObject.Find("LC").GetComponent<SoundAssets>();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        _sounds = GameObject.Find("LC").GetComponent<SoundAssets>();
        _dispenser = GameObject.Find("Dispenser").GetComponent<DispenserController>();
        _timeCounter = GetComponent<TimeCounter>();
        var audioSource = _dispenser.gameObject.GetComponent<AudioSource>();
        _lvlText = GameObject.Find("txtLevel").GetComponent<Text>();
        // Find the level text object if it exists and update it with the current level count.
        // Remember: Scenes "0" and "1" are SplashScreen and MainMenu so the first lvl has the index "2"!
        _lvlText.text = "Level " + (Application.loadedLevel - 1);
        audioSource.PlayOneShot(_sounds.LevelStart);

        _secToStart = LevelStartTime;
        StartCoroutine("WaitOne");
    }
예제 #3
0
    void Start()
    {
        // Get the SoundEffect storage
        _sounds = GameObject.Find("LC").GetComponent<SoundAssets>();

        //	Get the SpriteRenderer component for the GameObject's Rigidbody
        _spriteRenderer = GetComponent <SpriteRenderer> ();

        // Get the attached AudioSource compoenent
        _aSource = GetComponent<AudioSource>();

        //	Initialize the Hit Points
        _currentHitPoints = HitPoints;

        //	Calculate the Damage Impact Speed Squared from the Damage Impact Speed
        _damageImpactSpeedSqr = DamageImpactSpeed * DamageImpactSpeed;
    }
예제 #4
0
파일: Systems.cs 프로젝트: tarsupin/Nexus
 public static void AddAudio(GameClient game)
 {
     Systems.sounds = new SoundAssets(game);
     Systems.music  = new MusicAssets(game);
 }
예제 #5
0
 private void Awake()
 {
     instance = this;
 }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     _aSource = GetComponent<AudioSource>();
     _sounds = GameObject.Find("LC").GetComponent<SoundAssets>();
 }