コード例 #1
0
ファイル: DeathBomb.cs プロジェクト: Alx666/ProjectPhoenix
    private void Awake()
    {
        m_hActor = GetComponent<MadMaxActor>();
        m_hRigidbody = GetComponent<Rigidbody>();
        m_hLight = GetComponentInChildren<Light>();

        m_hBulb = new LightBulb(this);

        inactive = new StateInactive(this);
        active = new StateActive(this);
        explode = new StateExplode(this);

        inactive.Active = active;
        active.Inactive = inactive;
        active.Explode = explode;
        explode.Inactive = inactive;

        inactive.OnStateEnter();
        currentState = inactive;

        m_hBulb.Reset();
    }
コード例 #2
0
ファイル: MadMaxActor.cs プロジェクト: Alx666/ProjectPhoenix
    private void Damage(MadMaxActor hActor, float dmg)
    {
        if (hActor == this)
            return;

        LastActor = hActor;

        this.currentHealth -= hActor.GetImpactDamage(dmg);
        if (this.currentHealth <= 0f)
        {
            HealthBar.enabled = false;
            RpcDie(hActor.netId);
        }
    }