private void InitializeGuardedTile()        // run when an owner is assigned to this guarded tile.
    {
        if (PlayerDetector != null)
        {
            Destroy(PlayerDetector.gameObject);
        }
        if (AudioManager.Instance != null)
        {
            AudioManager.Instance.PlaySFX(GuardTileClaimed);
        }
        AreaOfAttack.enabled   = true;
        PlayerDetector.enabled = false;
        ButtonRender.material  = OwnedMaterial;
        PlayerPersonalization ownerPersonalization = state.EntityOwner.GetComponent <PlayerPersonalization>();

        colorIntensity = Player_Colors.GetColorIntensity(ownerPersonalization.GetColor());
        OwnerText.text = ownerPersonalization.GetName() + "'s tile";

        Color GuardedMaterialColor = state.EntityOwner.GetComponent <PlayerPersonalization>().PlayerGraphics.material.color;

        ButtonRender.material.color = GuardedMaterialColor;
        ButtonRender.material.SetColor("_EmissionColor", GuardedMaterialColor * colorIntensity * 0.6f); // change this multiplier.
        print("I am now claimed!");
        ButtonAnim.Play(AnimHashID);
    }
Example #2
0
 private void RestoreColorData()
 {
     if (BoltNetwork.IsServer)
     {
         BoltLog.Info("adding " + GetColor());
         Player_Colors.AddMaterial(GetColor());
     }
 }
    // play VFX?

    private void OnTriggerEnter(Collider other)         // not synced. Movement is synced so we do not need to sync this script online at all.
    {
        if (other.tag == Tags.PLAYER_TAG && PlayerMat.ContainsKey(other.gameObject))
        {
            Color PlayerCol = PlayerMat[other.gameObject];
            TileMaterial.material       = GlowingMaterial;
            TileMaterial.material.color = PlayerCol;
            TileMaterial.material.SetColor("_EmissionColor", PlayerCol * Player_Colors.GetColorIntensity(StringColors[PlayerCol])); // change this multiplier.
            InitiateTimer();
        }
    }
Example #4
0
    private void MaterialCallBack()
    {
        var mat = Player_Colors.GetColor(state.UserColor);        // player colors gets any color material based off a string

        foreach (var limb in PlayerLimbs)
        {
            limb.material = mat;                    // paint the characters
        }
        if (entity.IsOwner)
        {
            //FindObjectOfType<Inventory>().InitializeInventory(PlayerGraphics.material.color);
            state.UserColorData = mat.color;
        }
        LobbyTiles.AddPlayer(gameObject, PlayerGraphics.material.color, state.UserColor);            // remove this key
    }