Ejemplo n.º 1
0
    public void OnInvincible(float invincibleTime)
    {
        Time.timeScale = 1.2f;
        setInvincible(true);
        MobileInputHandler.EnableInput(true);

        System.Action functionToCall = () => ResetInvincibleState();
        MyMath.StopCalledFunction(this, functionRoutine);
        MyMath.RunFunctionAfter(functionToCall, this, invincibleTime, out functionRoutine);
    }
Ejemplo n.º 2
0
 public void OnlevelRestarted()
 {
     GetComponent <RagdollController>().EnableRagdoll(false);
     if (GetComponent <Rigidbody>())
     {
         GetComponent <Rigidbody>().isKinematic = false;
     }
     MobileInputHandler.EnableInput(true);
     anim.speed = 1;
     Invincible = false;
 }
Ejemplo n.º 3
0
    public void OnLevelComplete()
    {
        UnSubscribeFromEvent();

        // do stuff when level completes
        if (GetComponent <Rigidbody>())
        {
            GetComponent <Rigidbody>().isKinematic = true;
        }
        MobileInputHandler.EnableInput(false);
    }
Ejemplo n.º 4
0
 public void OnFreezed()
 {
     if (IsPlayerInvincible())
     {
         ApplyInvincibleStateAbility();
         return;
     }
     rb.isKinematic = true;
     anim.speed     = 0;
     MobileInputHandler.EnableInput(false);
     rb.isKinematic = false;
 }
Ejemplo n.º 5
0
    public void Init()
    {
        Debug.Log("UIActionManager Init Start");

        game.inputManager.Init(new InputManager.MobilePlatform(2, 0.1f, uicam));
        handler = game.inputManager.GetHandler <MobileInputHandler>();

        items = FindObjectsOfType <InteractiveItem>();
        foreach (InteractiveItem item in items)
        {
            game.inputManager.SetInput(new Ultimate.Input(item.buttonName));
        }
    }
Ejemplo n.º 6
0
    public void OnBombed()
    {
        if (IsPlayerInvincible())
        {
            ApplyInvincibleStateAbility();
            return;
        }

        MobileInputHandler.EnableInput(false);
        onBombedListeners?.Invoke();
        LevelManager.Instance.OnPlayerDied();

        ragdoll_rb.AddExplosionForce(30000, transform.position, 50);
    }
Ejemplo n.º 7
0
	static PlatformInputHandler GetPlatformInputHandler(RuntimePlatform platform) {
		PlatformInputHandler currentPlatformHandler = null;
		switch (platform) {
			case RuntimePlatform.Android:
			case RuntimePlatform.IPhonePlayer:
				currentPlatformHandler = new MobileInputHandler();
				break;
			case RuntimePlatform.WindowsEditor:
			case RuntimePlatform.OSXEditor:
			default:
				currentPlatformHandler = new EditorInputHandler();
				break;
			}

		return currentPlatformHandler;
	}
Ejemplo n.º 8
0
 public void OnLevelFailed()
 {
     // do stuff when level fails
     UnSubscribeFromEvent();
     MobileInputHandler.EnableInput(false);
 }