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.
47 lines
1.4 KiB
47 lines
1.4 KiB
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System;
|
||
|
using AX.MessageSystem;
|
||
|
|
||
|
public class SPControl : BaseShuiQiangControl
|
||
|
{
|
||
|
|
||
|
public override void InitGameObject()
|
||
|
{
|
||
|
part1 = transform.Find("XF_SP_/XF_SP").gameObject;
|
||
|
//if (MySceneManager.GetActiveScene().name.Contains("5"))
|
||
|
//{
|
||
|
// part1 = transform.FindChild("XF_SP_").gameObject;
|
||
|
//}
|
||
|
water = transform.Find("XF_SP_/XF_SP").transform.Find("Hose").gameObject;
|
||
|
}
|
||
|
public override void U(IMessage message)
|
||
|
{
|
||
|
if ((string)message.Data == this.gameObject.name)
|
||
|
{
|
||
|
if (MySceneManager.GetActiveScene().name.Contains("5"))
|
||
|
{
|
||
|
part1.transform.Rotate(Time.deltaTime * 40, 0, 0, Space.Self);
|
||
|
}
|
||
|
else if (MySceneManager.GetActiveScene().name.Contains("4"))
|
||
|
{
|
||
|
part1.transform.Rotate(Time.deltaTime * 40, 0, 0, Space.Self);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
public override void J(IMessage message)
|
||
|
{
|
||
|
if ((string)message.Data == this.gameObject.name)
|
||
|
{
|
||
|
if (MySceneManager.GetActiveScene().name.Contains("5"))
|
||
|
{
|
||
|
part1.transform.Rotate(-Time.deltaTime * 40, 0, 0, Space.Self);
|
||
|
}
|
||
|
else if (MySceneManager.GetActiveScene().name.Contains("4"))
|
||
|
{
|
||
|
part1.transform.Rotate(-Time.deltaTime * 40, 0, 0, Space.Self);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|