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.
35 lines
907 B
35 lines
907 B
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); |
|
} |
|
}
|
|
|