You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
907 B
36 lines
907 B
3 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using AX.TrackRecord;
|
||
|
using AX.MessageSystem;
|
||
|
|
||
|
public class LoadLineSize : MonoBehaviour {
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
|
||
|
MessageDispatcher.AddListener("LoadChangeLineSize", ChangeLineSize);
|
||
|
}
|
||
|
|
||
|
public void ChangeLineSize(IMessage mes)
|
||
|
{
|
||
|
ObjAttribute oriObj = (ObjAttribute)mes.Data;
|
||
|
if (oriObj.ObjName == gameObject.name)
|
||
|
{
|
||
|
ChangeSize(oriObj.lineSize);
|
||
|
}
|
||
|
}
|
||
|
public void ChangeSize(float size)
|
||
|
{
|
||
|
this.gameObject.GetComponent<lineParentMessage>().size = size;
|
||
|
foreach (Transform child in this.transform)
|
||
|
{
|
||
|
child.localScale = new Vector3(size, child.localScale.y, size);
|
||
|
}
|
||
|
}
|
||
|
private void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("LoadChangeLineSize", ChangeLineSize);
|
||
|
}
|
||
|
}
|