コード例 #1
0
        IEnumerator CountDown()
        {
            if (!MainCore.Instance.IsMachineDisabled)
            {
                GameStart.Instance.OpenOrCloseMessagePage(true, HiddenObjectPage.ResettingPage);
                int waitMachineNum = 20;
                while (DynaLinkHS.MechType == 0)
                {
                    yield return(new WaitForSeconds(1f));

                    Debug.LogWarning("<color=orange>Waiting for MechType!</color>");
                    waitMachineNum--;
                    if (waitMachineNum < 0)
                    {
                        break;
                    }
                }
                MachinePara.Initialize(DynaLinkHS.MechType);
                // Resetting
                yield return(StartCoroutine(PassiveMoveToRespawnLoc()));
            }

            // Show UITyingHandPage.
            PromptTyingHand();
            yield return("End CountDown!");
        }
コード例 #2
0
 private void Awake()
 {
     _uiCamera = GameObject.Find("HOGUICamera").GetComponent <Camera>();
     //FollowerObj.gameObject.SetActive(false);
     MachinePara.Initialize(DynaLinkHS.MechType);
     EventManager.Instance.AddListener(EventTypeSet.FinishGame, GameOverEvent);
     _canFollow = true;
 }
コード例 #3
0
        /// <summary>
        /// Run this function when creating target in PassiveState or AssistTractionVTState
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="speed"></param>
        /// <param name="torque"></param>
        public void MoveTo(Vector3 pos, int speed = 0, int torque = 0)
        {
            Vector3 machinePos = MachinePara.ToMachinePos(pos);

            switch (_mode)
            {
            case MachineMode.Passive:
                break;

            case MachineMode.AssistTractionVT:
                CmdSyncVectorTorqueTrapezoidalAst(machinePos.x, machinePos.y, torque);
                if (torque == 0)
                {
                    Debug.LogWarning("Torque is zero! Machine won't move!");
                }
                break;

            default:
                break;
            }
        }