private void OnCollisionExit(Collision collision) { if (collision.gameObject.tag == "Player") { platformSecondStatus = PlatformStatus.Previous; } }
public void MapToPlatformStatusEnum_FromString_ExpectedResult(string input, PlatformStatus expectedResult) { // Arrange + Act var result = input.MapToPlatformStatusEnum(); // Assert Assert.AreEqual(expectedResult, result); }
public void MapToString_FromPlatformStatusEnum_ExpectedResult(PlatformStatus input, string expectedResult) { // Arrange + Act var result = input.MapToString(); // Assert Assert.AreEqual(expectedResult, result); }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Player") { platformSecondStatus = PlatformStatus.Current; PlatformController.activePlatform = transform; PlatformController.canChangePlatform = true; spawnHandler.RunSpawner(); } }
/// <summary> /// Maps the <see cref="PlatformStatus"/> to its corresponding Tikkie API string. /// </summary> /// <param name="platformStatus">The platform status as enum.</param> /// <returns>The platform usage in string format.</returns> /// <exception cref="ArgumentException">When the platform status enum is not recognized.</exception> public static string MapToString(this PlatformStatus platformStatus) { switch (platformStatus) { case PlatformStatus.Active: return("ACTIVE"); case PlatformStatus.Inactive: return("INACTIVE"); default: throw new ArgumentException($"Not recognized {nameof(platformStatus)}"); } }
public bool Break() { if (m_BreakClip != null) { EazySoundManager.PlaySound(m_BreakClip); } Destroy(this.gameObject); m_PlatformStatus = PlatformStatus.Break; //m_TriggerCollider.enabled = false; GetComponentInChildren <SpriteRenderer>().enabled = false; return(GetComponentInChildren <SpriteRenderer>().enabled); }
private void ToFall() { if (RoleCtrl != null) { RoleCtrl.ToDead(); } ChildPlatformBeginFall(); m_Rigidbody.isKinematic = false; m_Rigidbody.velocity = Vector3.down * 7; m_Rigidbody.useGravity = true; Status = PlatformStatus.Fall; }
public IEnumerable <PlatformStatus> GetPlatformWithStatus() { IEnumerable <Platform> plats = getAllLowerPlats(); if (plats != null) { List <PlatformStatus> pStatus = new List <PlatformStatus>(); foreach (Platform p in plats) { PlatformStatus pfs = new PlatformStatus(p); BoolPacket bp = GatewayLinker.Instance.GetValue <BoolPacket>(new StringPacket(MessageCode.IsLowerOnline, p.Id)); pfs.Online = bp == null ? false : bp.Value; //获取状态。 pStatus.Add(pfs); } return(pStatus); } return(null); }
// Update is called once per frame void Update() { if (GameLevelSceneCtrl.Instance.GameStatus == GameStatus.Playing) { if (Status == PlatformStatus.Show) { m_Timer += Time.deltaTime; float process = m_Timer / m_StartDownTime; process = Mathf.Clamp01(process); transform.position = Vector3.Lerp(m_StartPos, m_EndPos, StartDownCurve.Evaluate(process)); if (process == 1) { Status = PlatformStatus.Stand; m_Timer = 0; } } else if (Status == PlatformStatus.Stand) { if (!CheckInCameraRange()) { m_Timer = m_StandTime; } if (BeginFall) { m_Timer += Time.deltaTime; if (m_Timer > m_StandTime) { ToFall(); } } } else if (Status == PlatformStatus.Fall) { if (!CheckInCameraRange(0)) { Destroy(this.gameObject); } } } BodyColorTweeningAndLayer(); }
//startFallTime 比跳跃的时间短一点 public void Init(Vector3 startPos, Vector3 endPos, float startFallTime, float standTime, PlatformStatus status, PlatformInfo platformInfo, PlatfromType platfromType = PlatfromType.Normal) { if (status == PlatformStatus.Show) { transform.position = startPos; } else { transform.position = endPos; } PlatfromType = platfromType; CurPlatformInfo = platformInfo; m_EndPos = endPos; m_StartPos = startPos; Status = status; m_Timer = 0; m_StandTime = standTime; m_StartDownTime = startFallTime; m_IsShowHide = false; }
// Use this for initialization void Start() { m_PlatformStatus = PlatformStatus.Normal; m_HasBody = true; m_TriggerCollider.GetComponent <Rigidbody>(); }
private void Start() { platformSecondStatus = PlatformStatus.None; }
private void Start() { platformFirstStatus = PlatformStatus.None; }
private void Start() { platformThirdStatus = PlatformStatus.None; }
protected bool CompareStatus(PlatformStatus stat) { return(status == stat ? true : false); }