示例#1
0
    private void UpdateState()
    {
        switch (blockState)
        {
        case WallBlockState.Emerging:
            if (Time.time > nextStateTime)
            {
                blockState = WallBlockState.Active;
            }
            break;

        case WallBlockState.Active:
            break;

        case WallBlockState.Expired:
            break;
        }
    }
示例#2
0
    protected virtual void StartEmerging()
    {
        blockState    = WallBlockState.Emerging;
        nextStateTime = Time.time + GameplayManager.blockEmergeDuration;

        // EmergeFX are assumed to be on&animating by default when they spawn
        GameObject fx = (GameObject)Instantiate(emergeFXPrefab) as GameObject;

        CodeTools.CopyTransform(transform, fx.transform, true, true, false);
        fx.transform.parent = transform;
        Destroy(fx, (GameplayManager.blockEmergeDuration + 2f));

        AudioSource audio = GetComponent <AudioSource>();

        if ((emergeSFX != null) && (audio != null))
        {
            audio.clip = emergeSFX;
            audio.PlayOneShot(emergeSFX, 0.3f);
        }
    }
示例#3
0
 protected void InitExpiredState()
 {
     blockState = WallBlockState.Expired;
 }