// Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     rb.AddForce(Vector3.down * 500);
     gameManager = FindObjectOfType <GameManager>();
     playSFX     = FindObjectOfType <PlaySFX>();
 }
Пример #2
0
 private void Awake()
 {
     InitializeCharacterData();
     sp           = GetComponent <SpriteRenderer>();
     res          = GetComponent <Respawner>();
     altSFXPlayer = GetComponent <PlaySFX>();
 }
Пример #3
0
 private void Awake()
 {
     anim       = GetComponent <Animator>();
     controller = GetComponent <PlayerController>();
     attacks    = GetComponents <AttackBase>();
     data       = GetComponent <CharacterData>();
     sfxPlayer  = GetComponent <PlaySFX>();
 }
 // Start is called before the first frame update
 void Start()
 {
     sr             = GetComponent <SpriteRenderer>();
     fieldDelay     = new WaitForSeconds(disruptiontime);
     characterList  = new List <CharacterData>();
     teslaAnimator  = GetComponent <Animator>();
     teslaLight     = GetComponentInChildren <Light>();
     shockSFXPlayer = GetComponent <PlaySFX>();
 }
 // Start is called before the first frame update
 void Start()
 {
     animator       = GetComponent <Animator>();
     dependecies    = GetComponents <AttackBase>();
     audioSource    = GetComponent <AudioSource>();
     controller     = GetComponent <EntityController>();
     normalInterval = (1 / (float)chargeLevels) - 0.001f;
     inv            = GetComponent <Inventory>();
     r         = GetComponent <SpriteRenderer>();
     sfxPlayer = GetComponent <PlaySFX>();
 }
Пример #6
0
    void Start()
    {
        quiver    = new Skewer[numberOfSkewers];
        quiver[0] = new Skewer();
        quiver[1] = new Skewer();
        quiver[2] = new Skewer();
        CanSwap   = true;
        sfxPlayer = GetComponent <PlaySFX>();

        //initialize dictionaries
        for (int i = 0; i < quiver.Length; i++)
        {
            quiver[i].InitializeDictionary();
        }
    }
Пример #7
0
    public override void OnTriggerEnter2D(Collider2D collision)
    {
        sfxPlayer = GetComponent <PlaySFX>();

        // skewer roots
        if (collision.gameObject.tag == "ThrowThrough")
        {
            var environment = collision.gameObject.GetComponent <DestructableEnvironment>();
            if (environment != null)
            {
                if (environment.skewerable)
                {
                    environment.health -= 1;
                    environment.Destroy();
                }
            }
        }

        // pickup  drops
        if (collision.gameObject.tag == "SkewerableObject")
        {
            if (!inventory.ActiveSkewerFull() && !inventory.ActiveSkewerCooked())
            {
                //Debug.Log("Hit skewerable object");
                SkewerableObject targetObject = collision.gameObject.GetComponent <SkewerableObject>();

                sfxPlayer.Play(pickUpSFX);

                inventory.AddToSkewer(targetObject.data);
                MGSTextSpawner.instance?.SpawnText(targetObject.data, transform.position);
                Destroy(collision.gameObject);
            }
            else
            {
                sfxPlayer.Play(cantPickUpSFX);
            }
        }

        //do knockback effects
        if (collision.gameObject.tag == "Predator" || collision.gameObject.tag == "Prey")
        {
            DoKnockBack(collision.gameObject.GetComponent <Rigidbody2D>(), bunceForce);
        }
    }
Пример #8
0
 private void Start()
 {
     #region Initialize
     #region GetComponents
     AiData       = GetComponent <AIData>();
     Checks       = AiData.GetComponent <MonsterChecks>();
     AnimatorBody = GetComponent <Animator>();
     RigidBody    = GetComponent <Rigidbody2D>();
     controller   = GetComponent <MonsterController>();
     pathfinder   = GetComponent <Pathfinder>();
     flavor       = GetComponent <FlavorInputManager>();
     sfxPlayer    = GetComponent <PlaySFX>();
     #endregion
     ActionTimer         = -1f;
     ActionTimerReset    = 5f;
     ActionTimerVariance = 2f;
     ResetTimer          = -1f;
     ResetTimerReset     = 6f;
     ResetTimerVariance  = 2f;
     ResetMovementBias();
     #endregion
 }
Пример #9
0
    // 0 - brickHit, 1 - paddleHit

    void Start()
    {
        rb          = GetComponent <Rigidbody>();
        playSFX     = FindObjectOfType <PlaySFX>();
        gameManager = FindObjectOfType <GameManager>();
    }