public override void Awake()
        {
            base.Awake();
            itemToCast = new CastItem(0, 0, 0);
            waitingActionForBubbleShieldItemMove.Initialise(this);
            waitingActionForBubbleShieldItemMove.ReInitialiseTimerToEnd(GameConfig.bubbleShieldItemMoveAttackRateTickRate);

            waitingActionForItemEyeLaserMove.Initialise(this);
            waitingActionForItemEyeLaserMove.ReInitialiseTimerToEnd(GameConfig.itemEyeLaserMoveAttackRateTickRate);

            waitingActionForItemFireballMove.Initialise(this);
            waitingActionForItemFireballMove.ReInitialiseTimerToEnd(GameConfig.itemFireballMoveAttackRateTickRate);

            boulderUsedCount       = GameConfig.boulderPlacementLimit;
            tidalWaveUsedCount     = GameConfig.tidalWaveLimit;
            tornadoPlacedUsedCount = GameConfig.tornadoPlacementLimit;
            fireballUsedCount      = GameConfig.fireballLimit;
            flamePillarUsedCount   = GameConfig.flamePillarLimit;
        }
        //authoratatively is performed
        public void SetAuthoratativeStates(PlayerAuthoratativeStates playerAuthoratativeStates)
        {
            if (statusSprite != null)
            {
                if (playerAuthoratativeStates.isPetrified && isPetrified != playerAuthoratativeStates.isPetrified)
                {
                    statusSprite.enabled = true;
                    statusSprite.color   = petrificationColor;
                }
                if (!playerAuthoratativeStates.isPetrified && isPetrified != playerAuthoratativeStates.isPetrified)
                {
                    statusSprite.enabled = false;
                }
                if (playerAuthoratativeStates.isInvincible && isInvincible != playerAuthoratativeStates.isInvincible)
                {
                    statusSprite.enabled = true;
                    statusSprite.color   = invincibleColor;
                }
                if (!playerAuthoratativeStates.isInvincible && isInvincible != playerAuthoratativeStates.isInvincible)
                {
                    statusSprite.enabled = false;
                }
            }

            if (playerAuthoratativeStates.inCharacterSelectionScreen && inCharacterSelectionScreen != playerAuthoratativeStates.inCharacterSelectionScreen)
            {
                //turn off model
                //turn on character selection screen
                //Debug.LogError("Turn off model");
                gameObject.transform.parent.gameObject.SetActive(false);
            }
            if (playerAuthoratativeStates.inGame && inGame != playerAuthoratativeStates.inGame)
            {
                //turn on model
                //turn off character selection screen
                //Debug.LogError("Turn on model");
                gameObject.transform.parent.gameObject.SetActive(true);
                if (CharacterSelectionScreen.instance.gameObject.activeSelf)
                {
                    CharacterSelectionScreen.instance.gameObject.SetActive(false);
                }
            }

            inCharacterSelectionScreen = playerAuthoratativeStates.inCharacterSelectionScreen;
            inGame              = playerAuthoratativeStates.inGame;
            hero                = playerAuthoratativeStates.hero;
            isInputFreezed      = playerAuthoratativeStates.inputFreezed;
            isMovementFreezed   = playerAuthoratativeStates.isMovementFreezed;
            isPetrified         = playerAuthoratativeStates.isPetrified;
            isPushed            = playerAuthoratativeStates.isPushed;
            isPhysicsControlled = playerAuthoratativeStates.isPhysicsControlled;
            isInvincible        = playerAuthoratativeStates.isInvincible;

            if (!isRespawnningPlayer && isRespawnningPlayer != playerAuthoratativeStates.isRespawnningPlayer)
            {
                //enable crosshair locally
                //disable collider
                if (statusSprite != null)
                {
                    statusSprite.gameObject.SetActive(false);
                }
                SetRespawnState();
            }
            if (isRespawnningPlayer && isRespawnningPlayer != playerAuthoratativeStates.isRespawnningPlayer)
            {
                //disable crosshair locally
                //enable back collider
                if (statusSprite != null)
                {
                    statusSprite.gameObject.SetActive(true);
                }
                SetSpawnState();
            }
            if (!isPhysicsControlled && isPhysicsControlled != playerAuthoratativeStates.isPhysicsControlled)
            {
                SetActorCollider(false);
            }
            if (isPhysicsControlled && isPhysicsControlled != playerAuthoratativeStates.isPhysicsControlled)
            {
                SetActorCollider(true);
            }

            isRespawnningPlayer = playerAuthoratativeStates.isRespawnningPlayer;

            currentHP         = playerAuthoratativeStates.currentHP;
            currentStockLives = playerAuthoratativeStates.currentStockLives;

            itemToCast = new CastItem((EnumData.CastItemTypes)playerAuthoratativeStates.itemToCast.castItemType
                                      , (EnumData.UsableItemTypes)playerAuthoratativeStates.itemToCast.usableItemType
                                      , playerAuthoratativeStates.itemToCast.itemCount);

            if (healthFillImage != null)
            {
                healthFillImage.fillAmount = (1f * currentHP) / maxHP;
                currentLifeStockText.text  = currentStockLives.ToString();
            }
        }
 public override void OnBodyCollidedWithFlamePillarItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.FlamePillarItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.ServerProjectiles, EnumData.UsableItemTypes.FlamePillar, GameConfig.flamepillarItemUses);
 }
 public override void OnBodyCollidedWithFireballItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.FireballItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.ClientProjectiles, EnumData.UsableItemTypes.Fireball, GameConfig.fireballItemUses);
 }
 public override void OnBodyCollidedWithEarthquakeItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.EarthQuakeItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.Earthquake, GameConfig.earthquakeItemUses);
 }
 public override void OnBodyCollidedWithTornadoItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.TornadoPullItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.Tornado, GameConfig.tornadoItemUses);
 }
 public override void OnBodyCollidedWithMightyWindItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.MightyWindItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.ServerProjectiles, EnumData.UsableItemTypes.MightyWind, GameConfig.mightywindItemUses);
 }
 public override void OnBodyCollidedWithGorgonGlassItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.GorgonGlassItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.GorgonGlass, GameConfig.gorgonglassItemUses);
 }
 public override void OnBodyCollidedWithMirrorItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.MirrorItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.MirrorItem, GameConfig.mirrorplacementItemUses);
 }
 public override void OnBodyCollidedWithCereberausHeadItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.CereberausHeadItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.CereberausHead, GameConfig.cereberausHeadItemUses);
 }
 public override void OnBodyCollidedWithPermamentBlockItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.PermamnentBlockItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.PermamnentBlock, GameConfig.permanentblockItemUses);
 }
 public override void OnBodyCollidedWithAeloianItemTiles(Vector3Int cellPos)
 {
     GridManager.instance.SetTile(cellPos, EnumData.TileType.AeloianMightItem, false, false);
     itemToCast = new CastItem(EnumData.CastItemTypes.SpawnnableItems, EnumData.UsableItemTypes.AeloianMight, GameConfig.aeloianmightItemUses);
 }