Exemplo n.º 1
0
 private void OnCollisionExit(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         platformSecondStatus = PlatformStatus.Previous;
     }
 }
Exemplo n.º 2
0
        public void MapToPlatformStatusEnum_FromString_ExpectedResult(string input, PlatformStatus expectedResult)
        {
            // Arrange + Act
            var result = input.MapToPlatformStatusEnum();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 3
0
        public void MapToString_FromPlatformStatusEnum_ExpectedResult(PlatformStatus input, string expectedResult)
        {
            // Arrange + Act
            var result = input.MapToString();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 4
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         platformSecondStatus = PlatformStatus.Current;
         PlatformController.activePlatform    = transform;
         PlatformController.canChangePlatform = true;
         spawnHandler.RunSpawner();
     }
 }
Exemplo n.º 5
0
        /// <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)}");
            }
        }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
    // 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();
    }
Exemplo n.º 10
0
    //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;
    }
Exemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     m_PlatformStatus = PlatformStatus.Normal;
     m_HasBody        = true;
     m_TriggerCollider.GetComponent <Rigidbody>();
 }
Exemplo n.º 12
0
 private void Start()
 {
     platformSecondStatus = PlatformStatus.None;
 }
Exemplo n.º 13
0
 private void Start()
 {
     platformFirstStatus = PlatformStatus.None;
 }
Exemplo n.º 14
0
 private void Start()
 {
     platformThirdStatus = PlatformStatus.None;
 }
Exemplo n.º 15
0
 protected bool CompareStatus(PlatformStatus stat)
 {
     return(status == stat ? true : false);
 }