Объединяю с работой dfilipkin
This commit is contained in:
1 parent
05bd220cad
commit
b167fc448f
240 files changed
+315725
-12011
No files matched your search
@@ -0,0 +1,35 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
public class Button : MonoBehaviour
|
||||
{
|
||||
public GameObject parent;
|
||||
public GameObject child;
|
||||
|
||||
private ParentMaterialChanger pMaterialChanger;
|
||||
private ChildMaterialChanger cMaterialChanger;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (parent != null)
|
||||
pMaterialChanger = parent.GetComponent<ParentMaterialChanger>();
|
||||
|
||||
if (child != null)
|
||||
cMaterialChanger = child.GetComponent<ChildMaterialChanger>();
|
||||
}
|
||||
|
||||
[ContextMenu("Change Materials")]
|
||||
public void ChildrenMaterials()
|
||||
{
|
||||
if (pMaterialChanger != null)
|
||||
pMaterialChanger.ChangeChildrenMaterials();
|
||||
else
|
||||
Debug.LogError("ParentMaterialChanger is null!");
|
||||
|
||||
if (cMaterialChanger != null)
|
||||
cMaterialChanger.ChangeChildrenMaterials();
|
||||
else
|
||||
Debug.LogError("ChildMaterialChanger is null!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user