Search Unity

How to change color of entity without change materials?

Discussion in 'Entity Component System' started by jintaenate, Jul 27, 2019.

  1. jintaenate

    jintaenate

    Joined:
    Sep 12, 2018
    Posts:
    17
    I use unity 2019.2b with LWRP

    In LWRP, change color of gameobject is
    Code (CSharp):
    1. gameObject.GetComponent<MeshRenderer>().material.SetColor("_BaseColor", color);
    after that i convert to entity via GameObjectConversionUtility

    Code (CSharp):
    1. Entity entity =  GameObjectConversionUtility.ConvertGameObjectHierarchy(instance.gameObject, World.Active);
    2. entityManager.SetName(entity, instance.name);
    3. Destroy(instance.gameObject);
    4. entityList.Add(entity);

    Here is my question.

    how can change color after converted to entity already.
     
    Last edited: Jul 27, 2019
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,779
    Is rather 1 year old and I am not sure how relevant may be, but here it is