// ========== MonoBehaviour methods ==========
 // ========== Public methods ==========
 public override void OnGetHitByBullet(GameObject bullet)
 {
     base.OnGetHitByBullet(bullet);
     if (config.POINT > 0)
     {
         FloatTextController.DoFloatUpText("+" + config.POINT.ToString(), transform.position, Colors.TURQUOISE);
         Manager.instance.AddPoint(config.POINT);
     }
     else
     {
         FloatTextController.DoFloatUpText(config.POINT.ToString(), transform.position, Colors.ALIZARIN);
         Manager.instance.SubPoint(Mathf.Abs(config.POINT));
     }
     return;
 }
Example #2
0
    private void OnDestroyedByLightningBall(GameObject sourceObject)
    {
        gameObject.GetComponent <Collider2D>().enabled = false;
        gameObject.GetComponent <IObjectMovement>().StopMoving();
        Invoke("DeactivateObject", _timeBeforeDeactivateObject);

        PointObjectConfig currentConfig = (PointObjectConfig)config;

        if (currentConfig.POINT > 0)
        {
            Manager.instance.AddPoint(currentConfig.POINT);
            FloatTextController.DoFloatUpText("+" + currentConfig.POINT.ToString(), transform.position, Colors.TURQUOISE);
        }
        gameObject.GetComponent <IObjectMovement>().StopMoving();
        gameObject.GetComponent <IShootableObjectAnimation>().DoEffectObjectAffectedByEffectObject(EffectObjectType.LIGHTNING_BALL, sourceObject);
    }