public void OnEnable()
    {
        behaviour = target as LevelItemBehaviour;

        behaviour.UpdateMaterial();
        prevType = behaviour.Type;
    }
Exemplo n.º 2
0
        public ItemSave(Item item, LevelItemBehaviour.ItemType type, Vector3 position, Vector3 rotation, Vector3 scale, bool isStatic)
        {
            this.item     = item;
            this.type     = type;
            this.position = position;
            this.rotation = rotation;
            this.scale    = scale;

            this.isStatic = isStatic;
        }
Exemplo n.º 3
0
 public static Material GetItemMaterial(LevelItemBehaviour.ItemType type)
 {
     if (type == LevelItemBehaviour.ItemType.Normal)
     {
         return(instance.itemMaterial);
     }
     else
     {
         return(instance.obstacleMaterial);
     }
 }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        if (behaviour.Type != prevType)
        {
            behaviour.UpdateMaterial();
        }

        prevType = behaviour.Type;
    }