Beispiel #1
0
    private void Start()
    {
        fCooldown   = m_fCooldown;
        m_fDuration = m_fDurationDefault;

        m_PlayerParticles = GetComponent <PlayerParticles>();
    }
Beispiel #2
0
    private void Awake()
    {
        elementNames.Add("Ice");
        elementNames.Add("Fire");
        elementNames.Add("Lightning");

        elementConversion.Add("Ice", 0);
        elementConversion.Add("Fire", 1);
        elementConversion.Add("Lightning", 2);

        for (int i = 0; i < 3; i++)
        {
            Orb     orb  = new Orb();
            Element elem = new Element();
            elem.Name = elementNames[i];
            orb.Type  = elem;
            orbInventory.Add(elementNames[i], 0);
        }

        oc     = GetComponent <OrbController>();
        player = GetComponent <Player>();

        pUI   = GameObject.FindGameObjectWithTag("uiManager").GetComponent <PlayerUI>();
        pAnim = GetComponent <PlayerAnimation>();
        oAud  = GameObject.FindGameObjectWithTag("OrbUse").GetComponent <OrbUse>();
        opAud = GameObject.FindGameObjectWithTag("OrbPickUp").GetComponent <OrbPickUp>();
        pPart = GetComponent <PlayerParticles>();
    }
Beispiel #3
0
 private void PlayerInit()
 {
     if (!rigid)
     {
         rigid = GetComponent <Rigidbody>();
     }
     if (!invComponent)
     {
         invComponent = GetComponent <InventoryComponent> ();
     }
     if (!abilities)
     {
         abilities = GetComponent <PlayerAbilities> ();
     }
     if (!energy)
     {
         energy = GetComponent <PlayerEnergy> ();
     }
     if (!pointLight)
     {
         pointLight = GetComponent <Light> ();
     }
     if (!sound)
     {
         sound = GetComponent <PlayerSound> ();
     }
     if (!particles)
     {
         particles = GetComponent <PlayerParticles> ();
     }
 }
 private void Start()
 {
     particles        = GetComponent <PlayerParticles>();
     info             = GetComponent <PlayerInfo>();
     rb               = GetComponent <Rigidbody>();
     trail            = GetComponent <TrailRenderer>();
     trail.startColor = info.thisPlayer.color;
     trail.endColor   = info.thisPlayer.color;
 }
    // Use this for initialization
    void Start()
    {
        m_DashUI          = gameObject.GetComponent <DashUI>();
        m_PlayerParticles = gameObject.GetComponent <PlayerParticles>();
        m_PlayerRB        = gameObject.GetComponent <Rigidbody>();

        m_PlayerRB.centerOfMass = m_CenOfMass.localPosition;

        m_fBoostEndTime = Time.fixedTime - m_fBoostCooldown;
    }
    // Deactivate ParticleSystem
    void DeactivateParticleRecticle()
    {
        PlayerParticles playerParticles = PlayerParticleSystem.GetComponent <PlayerParticles>();

        playerParticles.ToggleActive();
        ParticleSystemObj.SetActive(false);
        Recticle.SetActive(false);
        GamePlane.SetActive(true);
        StartCoroutine(VolumeFadeUp());
        playerParticles.ToggleActive();
    }
Beispiel #7
0
    void Start()
    {
        m_Animator      = GetComponent <Animator> ();
        m_Rigidbody     = GetComponent <Rigidbody> ();
        m_Capsule       = GetComponent <CapsuleCollider> ();
        mSkillManager   = mCanvas.GetComponent <SkillManager> ();
        playerParticles = GetComponent <PlayerParticles> ();
        m_CapsuleHeight = m_Capsule.height;
        m_CapsuleCenter = m_Capsule.center;

        m_Rigidbody.constraints   = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionZ;
        m_OrigGroundCheckDistance = m_GroundCheckDistance;
    }
Beispiel #8
0
    // Use this for initialization
    void Awake()
    {
        m_PlayerParticles = GetComponent <PlayerParticles>();

        m_LeftFood  = m_DefaultFood;
        m_RightFood = m_DefaultFood;

        m_LeftBackImage  = m_LeftImage.transform.parent.gameObject.GetComponent <RawImage>();
        m_RightBackImage = m_RightImage.transform.parent.gameObject.GetComponent <RawImage>();

        if (m_LeftBackImage)
        {
            m_DefaultBackColour = m_LeftBackImage.color;
        }
    }
    // TODO: Troubleshoot Death Animation!

    protected override void OnTakeDamage()
    {
        if (!invulnerable && currentHealth > 0)
        {
            Debug.Log("Player has taken damage!");

            currentHealth--;
            UpdateHealth();

            if (currentHealth != 0)
            {
                PlayerParticles.Play();
                StartCoroutine(RunInvincibilityFrames());
            }
            else
            {
                Died();
            }
        }
    }
Beispiel #10
0
    // Use this for initialization
    void Start()
    {
        m_PlayerParticles = m_PlayerInventory.gameObject.GetComponent <PlayerParticles>();

        // FOR each food in m_Foods
        for (int i = 0; i < m_Foods.Length; ++i)
        {
            // Add name of food to foodNames
            m_FoodNames.Add(m_Foods[i].m_sFoodName);

            // Add index to dictionary with name as key
            m_FoodsIndexByName.Add(m_Foods[i].m_sFoodName, i);

            // Add to inactive foods
            m_InactiveFoods.Add(m_Foods[i]);
        }

        // Initialise active food count
        m_nActiveFoodCount = new int[m_Foods.Length];

        // Set Next Spawn Time
        m_fNextSpawnTime = Time.time;
    }
Beispiel #11
0
 private void Start()
 {
     playerAnimator  = GetComponentInChildren <Animator>();
     playerParticles = GetComponentInChildren <PlayerParticles>();
 }