Esempio n. 1
0
 private void Awake()
 {
     rigidbody             = GetComponent <Rigidbody>();
     rigidbody.isKinematic = true;
     rsp   = GetComponent <RandomSoundPlayer>();
     rocky = 0;
 }
Esempio n. 2
0
 /// <summary> Create a new sound effect. The node parameter is the class that we look up the path relative from</summary>
 public SoundEffect(String path, Node node, uint delayInMilliseconds)
 {
     _delay = delayInMilliseconds;
     _node  = (Node)node.GetNodeOrNull(path);
     if (_node == null)
     {
         // We got no sound
         _type = SoundType.NO_SOUND;
     }
     else if (_node is RandomSoundPlayer)
     {
         _type     = SoundType.RANDOM_SOUND_CSHARP;
         _soundRnd = (RandomSoundPlayer)_node;
     }
     else if (_node.HasMethod(GD_RANDOM_SOUND_FUNCTION_NAME))
     {
         _type  = SoundType.RANDOM_SOUND_GD;
         _sound = (AudioStreamPlayer2D)_node;
     }
     else if (_node is AudioStreamPlayer2D)
     {
         _sound = (AudioStreamPlayer2D)_node;
         if (_sound.Stream != null)
         {
             _type = SoundType.NORMAL;
         }
     }
 }
 void Awake()
 {
     rb = GetComponent <Rigidbody2D>();
     randomSoundPlayer  = GetComponent <RandomSoundPlayer>();
     handHiddenPosition = hand.localPosition;
     handTrail.enabled  = false;
 }
        public void Open()
        {
            if (_coroHandle != null)
            {
                _coroHandle.Stop();
            }
            bubbleFrame.gameObject.SetActive(true);

            _inTransition = true;
            _coroHandle   = CoroutineExecutor.CreateTask(OpenTransition());
            _coroHandle.Start();

            RandomSoundPlayer.PlaySoundFx(openSound, 0.3f);
        }
Esempio n. 5
0
    // METHODS -----
    new void Start()
    {
        base.Start();
        _weaponTrail = GetComponentInChildren<TrailRenderer>();
        _attackPlanePoint = GetComponentInChildren<PlaneSpawner>();

        SoundController = GetComponent<RandomSoundPlayer>();

        CollectRadius += 1;

        // TESTING
        AddEffectToWeapons(new Damage(25));

        ui = GameObject.Find("UI").GetComponent<SpiritMeterUI>();
        if (DashEnabled) {
            _dashTrail = GetComponent<TrailRenderer> ();
        }
        _mainCamera = GameObject.FindGameObjectWithTag("MainCamera").camera;
        _reviveHeartPrefab = (GameObject) Resources.Load("ReviveHeart");

        //currentSpiritPower = gameObject.AddComponent<SpiritBungie>();
        //currentSpiritPower = gameObject.AddComponent<SpiritLightning>();
        //currentSpiritPower = gameObject.AddComponent<SpiritPingPong>();
        //currentSpiritPower = gameObject.AddComponent<SpiritImmortal>();

        currentSpiritPower = gameObject.AddComponent<SpiritBungie>();

        aspect = GetComponentInChildren<EntityRig>().Entity.GetAspect("twinhero");

        //Search for menu settings
        GameObject levelInfo = GameObject.Find("LevelCreationInfo");
        if (levelInfo != null) {
            spiritRegen = levelInfo.GetComponent<LevelCreationInfo>().spiritRegen;
            _damageRecievedModifier = levelInfo.GetComponent<LevelCreationInfo>().DamageRecievedModifier;
        }
    }
Esempio n. 6
0
    protected new void Start()
    {
        base.Start();

        HealthBar = GameObject.CreatePrimitive(PrimitiveType.Plane);
        HealthBar.renderer.material.color = Color.red;
        HealthBar.transform.parent = transform;
        HealthBar.transform.position = transform.position + Vector3.up * HealthBarPosition;
        HealthBar.collider.enabled = false;
        var s = new Vector3(HealthBarWidth, 1f, 0.01f);
        HealthBar.transform.localScale = s;

        AddEffectToWeapons(new Damage(BaseDamage));

        ai = GetComponentInChildren<AIRig>();
        ai.AI.Motor.DefaultSpeed = MovementSpeed;

        _randomSounds = GetComponent<RandomSoundPlayer>();
        _randomSounds.PlayRandomSound("Warcry");
    }