void Awake() { coin = transform.FindChild("coin"); // label = transform.FindChild("label").GetComponent<UILabel>(); label = transform.FindChild("label").GetComponent <NumItem>(); curTrans = this.transform; }
void Awake() { UICam = Utility.GetUICam(); // 如果在 Inspector 面板上没有赋值,那么就会通过查找方式获取下面的物件. if (canonBarrelTrans == null) { canonBarrelTrans = transform.FindChild("canonBarrelTrans"); } if (canonBarrelTrans_robot == null) { canonBarrelTrans_robot = transform.FindChild("canonBarrelTrans_robot"); } if (bulletShowUpPos_robot == null) { bulletShowUpPos_robot = canonBarrelTrans_robot.FindChild("bulletShowUpPos"); } if (barrelAnchor == null) { barrelAnchor = canonBarrelTrans.FindChild("barrelAnchor"); } // if(stationAnimator) // { // stationAnimator = transform.FindChild("station").GetComponent<Animator>(); // } if (bulletShowUpPos == null) { bulletShowUpPos = canonBarrelTrans.FindChild("bulletShowUpPos"); } if (plyScoreLabel) { plyScoreLabel = transform.FindChild("plyScoreLabel").GetComponent <UILabel>(); } if (bulletPowerLabel) { bulletPowerLabel = transform.FindChild("bulletPowerLabel").GetComponent <UILabel>(); } if (bulletMultiLabel) { bulletMultiLabel = transform.FindChild("bulletMulti").FindChild("bulletMultiLabel").GetComponent <NumItem>(); } if (bubbleShowUpPos == null) { bubbleShowUpPos = transform.FindChild("bubbleShowUpPos"); } if (cylinderShowUpPos == null) { cylinderShowUpPos = transform.FindChild("cylinderShowUpPos"); } if (cylinderTargetPos == null) { cylinderTargetPos = transform.FindChild("cylinderTargetPos"); } if (lockStartPos == null) { lockStartPos = canonBarrelTrans.FindChild("lockStartPos"); } if (highScorePos == null) { highScorePos = transform.FindChild("highScorePos"); } if (coinHomePos == null) { coinHomePos = transform.FindChild("coinHomePos"); } if (peakHint == null) { peakHint = transform.FindChild("peakHint"); } if (addBarrelValue == null) { addBarrelValue = transform.FindChild("addBarrelValue"); } }