Пример #1
0
    private void OnEnable()
    {
        redGun    = Resources.Load <Sprite>("boss_gun_red");
        blueGun   = Resources.Load <Sprite>("boss_gun_blue");
        redFlash  = Resources.Load <Sprite>("boss_gun_red_WHITE");
        blueFlash = Resources.Load <Sprite>("boss_gun_blue_WHITE");

        spriteRenderer = transform.GetChild(0).GetComponent <SpriteRenderer>();

        layer            = LayerMask.NameToLayer("Projectile");
        parentStates     = transform.parent.parent.GetComponent <DualShockerStates>();
        projectilePrefab = Resources.Load <GameObject>("BasicProjectile");

        if (gameObject.tag == "Red")
        {
            color = Projectile.Color.RED;
        }
        if (gameObject.tag == "Blue")
        {
            color = Projectile.Color.BLUE;
        }

        gunHealth = 20f;
    }
Пример #2
0
 /// <summary>
 /// Called on object enable. Resets all variables to their default values
 /// to ensure AI runs properly
 /// </summary>
 private void OnEnable()
 {
     states = GetComponent <DualShockerStates>();
     states.currentState = DualShockerStates.DSStates.SPAWN;
 }
Пример #3
0
 private void OnEnable()
 {
     statesParent = GetComponent <DualShockerStates>();
     health       = 50f;
 }