Ejemplo n.º 1
0
 IEnumerator StepUpdate()
 {
     while (Application.isPlaying)
     {
         if (CrossPlatformInputManager.GetButtonDown("Fire1") && Reticle.Is == Reticle.ReticleType.grab)
         {
             GRAB?.Invoke();
             yield return(new WaitForSeconds(0.2f));
         }
         if (CrossPlatformInputManager.GetButton("Fire1") && Reticle.Is == Reticle.ReticleType.shoot)
         {
             FIRE?.Invoke();
         }
         if (CrossPlatformInputManager.GetButtonDown("Inventory") && m_fpc.IsGrounded())
         {
             INVENTORY?.Invoke();
             m_inInventory = !m_inInventory;
             ToggleCursor(m_inInventory);
             m_fpc.enabled = !m_inInventory;
             m_cam.enabled = !m_inInventory;
         }
         if (CrossPlatformInputManager.GetButtonDown("Flashlight") && WeaponManager.HasFlashlight)
         {
             WeaponManager.current.ToggleFlashlight();
         }
         yield return(null);
     }
 }
Ejemplo n.º 2
0
        /// <summary>指令处理</summary>
        public ASObject Switch(int moduleNumber, int commandNumber, TGGSession session, ASObject data)
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif
            if (!CommonHelper.IsOpen(session.Player.Role.Kind.role_level, (int)OpenModelType.一夜))
            {
                return(CommonHelper.ErrorResult(ResultType.BASE_PLAYER_LEVEL_ERROR));
            }
            var aso = new ASObject();
            //指令匹配
            switch (commandNumber)
            {
            case (int)BuildingCommand.ENTER:
            {
                aso = ENTER.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.GET_WOOD:
            {
                aso = GET_WOOD.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.TORCH:
            {
                aso = TORCH.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.MAKE_BUILD:
            {
                aso = MAKE_BUILD.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.BUILDING:
            {
                aso = BUILDING.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.FIRE:
            {
                aso = FIRE.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.EXIT:
            {
                aso = EXIT.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.MOVING:
            {
                aso = MOVING.getInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.KILL_BOSS:
            {
                aso = KILL_BOSS.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.BACK_POINT:
            {
                aso = BACK_POINT.GetInstance().CommandStart(session, data);
                break;
            }
            }
#if DEBUG
            sw.Stop();
            XTrace.WriteLine("指令 {1} 运行总耗时:{0} 毫秒", sw.ElapsedMilliseconds.ToString(), GetType().Namespace);
#endif
            return(aso);
        }
Ejemplo n.º 3
0
    //hmm...what's this for?
    void Start() {
        //when you reload a scene if you don't reset the particles sometimes they 
        //are added or not reset correctly, so...bam, fixed
        ParticleSystem[] pses = GetComponentsInChildren<ParticleSystem>();
        foreach(ParticleSystem ps in pses) {
            ps.Clear();
        }
        
        heartSystemScript = FindObjectOfType<PlayerHeart>();
        FIREUIScript = FindObjectOfType<FIRE>();

        sweetHeart = GameObject.Find("SweetHeartLife");
        canLight = false;
        fireTail = GameObject.Find("FireTail").GetComponent<ParticleSystem>();
        makeMeBig = GameObject.Find("IWannaBeBig").GetComponent<ParticleSystem>();
        makeMeSmall = GameObject.Find("IWannaBeSmall").GetComponent<ParticleSystem>();
        makeMeSmallIfForced = GameObject.Find("SmallForced").GetComponent<ParticleSystem>();
        teleportBam = GameObject.Find("TeleportBam").GetComponent<ParticleSystem>();
        fireStandard = GameObject.Find("FireAbilityStandard");

        flicker = GameObject.Find("Flicker");
        flickerGradient = flicker.GetComponent<ParticleSystem>().colorOverLifetime;
        flickerScript = flicker.GetComponent<FlickerGradients>();

        flickerHeart = GameObject.Find("FlickerHeart");
        flickerHeartGradient = flickerHeart.GetComponent<ParticleSystem>().colorOverLifetime;
        flickerHeartScript = flickerHeart.GetComponent<FlickerGradients>();

        torchGradient = fireTail.colorOverLifetime;
        torchScript = fireTail.GetComponent<FlickerGradients>();

        explosionGradient = makeMeBig.colorOverLifetime;
        explosionScript = makeMeBig.GetComponent<FlickerGradients>();

        fireEmission = fireTail.emission;
        fireShape = fireTail.shape;
        distanceGreatEnough = true;
        sexyBody = GetComponent<Rigidbody2D>();
        unkillAbleDest = true;

        beatLevelTime = int.MaxValue;

        hasJoystick = Input.GetJoystickNames().Length > 0;
        Debug.Log(hasJoystick);

        SizeFix();   
    }
Ejemplo n.º 4
0
	// Use this for initialization
	void Start () {
        player = FindObjectOfType<Player>();
        FIREUIScript = FindObjectOfType<FIRE>();
    }