// Use this for initialization void Start() { transform.eulerAngles = Vector3.up * 90; playerPhysics = GetComponent<PlayerPhysics> (); animator = GetComponent<Animator> (); manager = Camera.main.GetComponent<GameManager>(); }
void Start() { playerPhysics = GetComponent <PlayerPhysics>(); initialPosition = this.transform.position; floatyLocation = this.transform.Find("FloatyLocation").gameObject; Reset(); }
public static void Postfix(PlayerPhysics __instance) { if (__instance.AmOwner && __instance.myPlayer.CanMove && GameData.Instance && isStealthed(__instance.myPlayer)) { __instance.body.velocity *= speedBonus; } if (isRole(__instance.myPlayer)) { var ninja = __instance.myPlayer; if (ninja == null || ninja.isDead()) { return; } bool canSee = PlayerControl.LocalPlayer.isImpostor() || PlayerControl.LocalPlayer.isDead() || (Lighter.canSeeNinja && PlayerControl.LocalPlayer.isRole(RoleType.Lighter) && Lighter.isLightActive(PlayerControl.LocalPlayer)); var opacity = canSee ? 0.1f : 0.0f; if (isStealthed(ninja)) { opacity = Math.Max(opacity, 1.0f - stealthFade(ninja)); ninja.MyRend.material.SetFloat("_Outline", 0f); } else { opacity = Math.Max(opacity, stealthFade(ninja)); } setOpacity(ninja, opacity); } }
void Start() { actionController = GetComponent <ActionController> (); controller = GetComponent <InputController> (); physics = GetComponent <PlayerPhysics>(); animator = GetComponent <Animator> (); }
static bool Prefix(PlayerPhysics __instance) { ModdedPlayerClass moddedController = Main.Instance.ModdedPlayerById(__instance.myPlayer.PlayerId); if (__instance.myPlayer != PlayerControl.LocalPlayer || moddedController?.Role?.RoleName != "Bellatrix" || ((Bellatrix)moddedController.Role).MindControlledPlayer == null) { return(true); } PlayerPhysics controlledPlayer = ((Bellatrix)moddedController.Role).MindControlledPlayer._Object.MyPhysics; GameData.PlayerInfo data = moddedController._Object.Data; bool flag = data != null && data.IsDead; Vector2 vel = HudManager.Instance.joystick.Delta * __instance.TrueSpeed; controlledPlayer.body.velocity = vel; MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)Packets.MoveControlledPlayer, Hazel.SendOption.Reliable); writer.Write(controlledPlayer.myPlayer.PlayerId); writer.Write(vel.x); writer.Write(vel.y); writer.EndMessage(); return(false); }
private void OnTriggerExit2D(Collider2D collider) { if (collider.gameObject.CompareTag("Ground")) { PlayerPhysics.DashWall(false); } }
// Use this for initialization void Start() { CanBePushed = true; cantmove = false; Disguise = state.Idle; playerphysics = GetComponent <PlayerPhysics>(); }
public void OnCollisionEnter2D(Collision2D col) { if (col.collider.tag == "Letter" || col.collider.tag == "Walkable" || col.collider.tag == "TempWalkable") { BoxCollider2D collider = GetComponent <BoxCollider2D> (); ContactPoint2D contact = col.contacts [0]; //hit the bottom of the umbrella if (contact.normal.y >= contact.normal.x) { //turn umbrella up instead of destroying it? if (attached != null) { PlayerPhysics pc = attached.transform.GetComponent <PlayerPhysics> (); if (pc != null) { pc.exitedStringItemState(); } } attached = null; Destroy(this.gameObject); } } }
public static void Postfix(PlayerPhysics __instance) { if (__instance.myPlayer && __instance.myPlayer.Data.IsDead) { __instance.myPlayer.Visible = PlayerControl.LocalPlayer.Data.IsDead; } }
void Start() { playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); animator.SetLayerWeight(1, 1); }
public void Tick7Left2Right() { PlayerPhysics playerPhysics = new PlayerPhysics(); var acceleration = playerPhysics.GetAcceleration(); var resistance = playerPhysics.GetResistance(); double expectedVelocity; playerPhysics.AccelerateLeft(); playerPhysics.CalculateVelocityThisTick(); expectedVelocity = acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += acceleration - resistance; playerPhysics.StopAccelerateLeft(); playerPhysics.AccelerateRight(); playerPhysics.CalculateVelocityThisTick(); expectedVelocity += -acceleration - resistance; playerPhysics.CalculateVelocityThisTick(); expectedVelocity += -acceleration - resistance; Assert.AreEqual(expectedVelocity, playerPhysics.GetVelocity()); }
void Awake() { _hookLine = GetComponentInChildren<LineRenderer>(); _timeBorn = Time.time; _player = GameObject.FindGameObjectWithTag("Player"); _physics = _player.GetComponent<PlayerPhysics>(); }
// Start is called before the first frame update void Start() { m_spr = this.gameObject.GetComponent <SpriteRenderer>(); m_animator = this.gameObject.GetComponent <Animator>(); m_pp = this.gameObject.GetComponent <PlayerPhysics>(); m_t = this.gameObject.GetComponent <Transform>(); }
void Awake() { instance = this; player = GameObject.FindWithTag("player"); playerPhysics = player.GetComponent<PlayerPhysics>(); }
public void Inject(PlayerUnitDI di) { physics = di.physics; stateMachine = di.stateMachine; hp = di.hp; vulnerability = di.vulnerability; }
void Start() { playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); prevmoveDir = 0; transform.Rotate (Vector3.up, 90, Space.World); }
public void SetUnharvested(bool instant) { //instant occurs on a level reset if (instant) { if (WasHarvested && !canBeHarvested) { spriteRenderer.material = new Material(Resources.Load("Materials/Graphic/Active Letter") as Material); foreach (MeshRenderer mr in GetComponentsInChildren <MeshRenderer>()) { mr.material.color = spriteRenderer.material.GetColor("_EffectColor"); } canBeHarvested = true; WasHarvested = false; PlayerPhysics pp = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPhysics> (); if (pp.collisionLetter == this) { pp.CheckForCollisions(); } GameManager.increment_letters_active(); } } else { if (!canBeHarvested) { StartCoroutine("TransitionToUnharvested"); } } }
public void Inject(PlayerUnitDI di) { stateMachine = di.stateMachine; physics = di.physics; flip = di.flip; vulnerability = di.vulnerability; }
// Use this for initialization void Start() { player = GameObject.FindWithTag("player"); barObject = GameObject.FindWithTag ("barObject"); playerPhysics = player.GetComponent<PlayerPhysics>(); bar = barObject.GetComponent<bar>(); }
// Use this for initialization void Start() { spriteRenderer = GetComponent <SpriteRenderer> (); pphysics = GetComponent <PlayerPhysics> (); originalPosition = transform.position; baseMovespeed = pphysics.movespeed; jumpTime = 0; mainCamera = Camera.main.GetComponent <CameraController> (); mainCamera.setLocation(transform.position.x, transform.position.y); //items bellows = GameObject.Find("bellows"); bellows.SetActive(false); timer = GameObject.Find("Timer_TimeLeft").GetComponent <TimerPowerup>(); audio = new List <AudioSource>(GetComponents <AudioSource> ()); anim = GetComponent <Animator> (); collidingWithLetter = false; GameManager.signUpForNewLetterEvent(this); }
// Use this for initialization void Start() { _ui = GameObject.Find("Keys"); _input = new PlayerInput(); _input.Reset (); _controller = this.GetComponent<PlayerPhysics>(); }
void Start () { currentGravity = regularGravity; playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); manager = Camera.main.GetComponent<GameManager>(); //animator.SetLayerWeight(1,1); }
public void Inject(PlayerUnitDI di, WallSlideRaycaster raycaster) { wallSlideRaycaster = raycaster; physics = di.physics; movement = di.abilities.movement; jump = di.abilities.jump; }
public override float HitTest(Ball ball, float dTime, CollisionEvent coll, PlayerPhysics physics) { if (!IsEnabled) { return(-1.0f); } // transform ball to cylinder coordinate system var oldPos = ball.State.Pos.Clone(); var oldVel = ball.Hit.Vel.Clone(); ball.State.Pos.ApplyMatrix2D(Matrix); ball.State.Pos.ApplyMatrix2D(Matrix); // and update z bounds of LineZ with transformed coordinates var oldZ = new Vertex2D(HitBBox.ZLow, HitBBox.ZHigh); HitBBox.ZLow = ZLow; // HACK; needed below // evil cast to non-const, should actually change the stupid HitLineZ to have explicit z coordinates! HitBBox.ZHigh = ZHigh; // dto. var hitTime = base.HitTest(ball, dTime, coll, physics); ball.State.Pos.Set(oldPos.X, oldPos.Y, oldPos.Z); // see above ball.Hit.Vel.Set(oldVel.X, oldVel.Y, oldVel.Z); HitBBox.ZLow = oldZ.X; // HACK HitBBox.ZHigh = oldZ.Y; // dto. if (hitTime >= 0) { // transform hit normal back to world coordinate system coll.HitNormal.Set(Matrix.MultiplyVectorT(coll.HitNormal)); } return(hitTime); }
// Use this for initialization void Start() { playerPhysics = GetComponent <PlayerPhysics> (); animator = GetComponent <Animator> (); manager = Camera.main.GetComponent <GameManager> (); animator.SetLayerWeight(1, 1); }
public static void PostfixPhysics(PlayerPhysics __instance) { if (__instance.AmOwner && GameData.Instance && __instance.myPlayer.CanMove) { __instance.body.velocity *= __instance.myPlayer.GetAppearance().SpeedFactor; } }
public void Execute(GameObject player, Vector2 axes, PlayerPhysics physics) { if (!Enabled && !Active) { return; } if (Physics == null) { Physics = physics; TotalDuration = Physics.AntigravityDuration; } if (Physics.GravityEnabled) { Timer = 0.0f; Physics.GravityEnabled = false; Active = true; Powerbar.SetActive(true); PowerbarSlider.value = 1; c_Shake.SmallShake(0.1f); } else { Physics.GravityEnabled = true; Active = false; Enabled = false; c_Shake.SmallShake(0.1f); } }
/// <summary> /// Use this for initialisation. /// </summary> void Start() { m_playerPhysics = gameObject.GetComponent <PlayerPhysics>(); if (!m_playerPhysics) { Debug.LogError("Could not find component PlayerPhysics"); } m_playerRotation = gameObject.GetComponent <PlayerRotation>(); if (!m_playerRotation) { Debug.LogError("Could not find component PlayerRotation"); } m_camera = Camera.main; if (!m_camera) { Debug.LogError("Could not find component Camera"); } m_slingshotDirectionIndicator = GameObject.FindObjectOfType <SlingshotDirectionIndicator>(); if (!m_slingshotDirectionIndicator) { Debug.LogError("Could not find component SlingshotDirectionIndicator"); } m_gameManager = GameObject.FindObjectOfType <GameManager>(); if (!m_gameManager) { Debug.LogError("Could not find component GameManager"); } // Hide the slingshot input until needed m_slingshotDirectionIndicator.StopSlingshotInput(); }
public static void Postfix(PlayerPhysics __instance) { if (isRole(__instance.myPlayer)) { var fox = __instance.myPlayer; if (fox == null || fox.isDead()) { return; } bool canSee = PlayerControl.LocalPlayer.isRole(RoleType.Fox) || PlayerControl.LocalPlayer.isRole(RoleType.Immoralist) || PlayerControl.LocalPlayer.isDead() || (PlayerControl.LocalPlayer.isRole(RoleType.Lighter) && Lighter.isLightActive(PlayerControl.LocalPlayer)); var opacity = canSee ? 0.1f : 0.0f; if (isStealthed(fox)) { opacity = Math.Max(opacity, 1.0f - stealthFade(fox)); fox.MyRend.material.SetFloat("_Outline", 0f); } else { opacity = Math.Max(opacity, stealthFade(fox)); } Ninja.setOpacity(fox, opacity); } }
// Start is called before the first frame update void Start() { playerPhysics = GetComponent <PlayerPhysics>(); mySpriteRenderer = GetComponent <SpriteRenderer>(); gameManagor = GameObject.Find("Main Camera").GetComponent <GameMan>(); characterInfo = new CharacterInformation(10, 2, 100); }
void Start() { playerPhysics = GetComponent <PlayerPhysics>(); animator = GetComponent <Animator>(); animator.SetLayerWeight(1, 1); }
void Start() { playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); playerCamera = GameObject.FindGameObjectsWithTag("MainCamera")[0]; playerPhysics.SetVelocity(Velocity); }
public void Inject(PlayerUnitDI di) { physics = di.physics; input = di.mainDi.controller.input; flip = di.flip; ReadStats(di.stats.Data); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerPhysics = GetComponent<PlayerPhysics> (); manager = Camera.main.GetComponent<GameManager> (); movable = GameObject.FindGameObjectWithTag("Movable"); }
/// <summary> /// Inicia o jogador /// </summary> void Start() { playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); manager = Camera.main.GetComponent<GameManager>(); animator.SetLayerWeight(0, 0); }
// Use this for initialization void Start() { transform.eulerAngles = Vector3.up * 90; playerPhysics = GetComponent <PlayerPhysics> (); animator = GetComponent <Animator> (); manager = Camera.main.GetComponent <GameManager>(); }
// Use this for initialization void Start() { mPlayer = GetComponent<PlayerPhysics>(); if(mPlayer == null){ Debug.LogError("needs a Physics compo."); } }
public static void setLook(this PlayerControl target, String playerName, int colorId, string hatId, string visorId, string skinId, string petId) { target.RawSetColor(colorId); target.RawSetVisor(visorId); target.RawSetHat(hatId, colorId); target.RawSetName(hidePlayerName(PlayerControl.LocalPlayer, target) ? "" : playerName); SkinData nextSkin = DestroyableSingleton <HatManager> .Instance.GetSkinById(skinId); PlayerPhysics playerPhysics = target.MyPhysics; AnimationClip clip = null; var spriteAnim = playerPhysics.Skin.animator; var currentPhysicsAnim = playerPhysics.Animator.GetCurrentAnimation(); if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.RunAnim) { clip = nextSkin.viewData.viewData.RunAnim; } else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.SpawnAnim) { clip = nextSkin.viewData.viewData.SpawnAnim; } else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.EnterVentAnim) { clip = nextSkin.viewData.viewData.EnterVentAnim; } else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.ExitVentAnim) { clip = nextSkin.viewData.viewData.ExitVentAnim; } else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.IdleAnim) { clip = nextSkin.viewData.viewData.IdleAnim; } else { clip = nextSkin.viewData.viewData.IdleAnim; } float progress = playerPhysics.Animator.m_animator.GetCurrentAnimatorStateInfo(0).normalizedTime; playerPhysics.Skin.skin = nextSkin.viewData.viewData; if (playerPhysics.Skin.layer.material == DestroyableSingleton <HatManager> .Instance.PlayerMaterial) { PlayerControl.SetPlayerMaterialColors(colorId, playerPhysics.Skin.layer); } spriteAnim.Play(clip, 1f); spriteAnim.m_animator.Play("a", 0, progress % 1); spriteAnim.m_animator.Update(0f); if (target.CurrentPet) { UnityEngine.Object.Destroy(target.CurrentPet.gameObject); } target.CurrentPet = UnityEngine.Object.Instantiate <PetBehaviour>(DestroyableSingleton <HatManager> .Instance.GetPetById(petId).viewData.viewData); target.CurrentPet.transform.position = target.transform.position; target.CurrentPet.Source = target; target.CurrentPet.Visible = target.Visible; PlayerControl.SetPlayerMaterialColors(colorId, target.CurrentPet.rend); }
public bool aiPickup2 = false; //used to initiate an item pickup protected virtual void Awake() { physics = GetComponent <PlayerPhysics>(); animator = GetComponent <CustomAnimator>(); box = GetComponent <BoxCollider2D>(); ai = GetComponent <AiBase>(); passives = new List <Item>(); }
public PlayerFallEvent(PlayerPhysics playerPhysics, Rigidbody playerRigidbody) { _PhysicsPlayer = playerPhysics; _PlayerRigidbody = playerRigidbody; _PlayerTransform = playerRigidbody.transform; _MaxFallSpeed = -9.8f; _FallSpeed = -4.9f; }
// Use this for initialization void Start() { spriteRenderer = GetComponent <SpriteRenderer> (); //anim = GetComponentInChildren<Animator> (); shipAnim = GetComponent <Animator>(); // bulletPhysics = GetComponent <BulletPhysics> (); playerPhysics = GetComponent <PlayerPhysics> (); }
public PlayerSprintEvent(PlayerPhysics playerPhysics, Rigidbody playerRigidbody) { _PhysicsPlayer = playerPhysics; _PlayerRigidbody = playerRigidbody; _PlayerTransform = playerRigidbody.transform; //_MaxSprintSpeed = 6.0f; _SprintSpeed = 6.0f; }
// Use this for initialization void Start() { spriteRenderer = GetComponent<SpriteRenderer> (); //anim = GetComponentInChildren<Animator> (); shipAnim = GetComponent<Animator>(); // bulletPhysics = GetComponent <BulletPhysics> (); playerPhysics = GetComponent <PlayerPhysics> (); }
void Start() { playerPhysics = GetComponent<PlayerPhysics>(); animator = GetComponent<Animator>(); manager = Camera.main.GetComponent<GameManager>(); animator.SetLayerWeight(1,1); throwing = false; facingRight = true; }
// Use this for initialization void Start() { playerPhysics = GetComponent<PlayerPhysics>(); //gets starting kill count //curKillCount = PlayerPhysics.killCount; //Caching the transform _t = transform; }
// Use this for initialization void Start () { playerPhysics = GetComponent<PlayerPhysics>(); inputHandler = GetComponent<InputHandler>(); animator = GetComponent<Animator> (); transform.eulerAngles = Vector3.up * 90; //running = false; jumping = false; sliding = false; autoStarted = false; gravity = Vector3.down * gravityPull; }
void Start() { // The controller is what handles our movement in the game world controller = GetComponent<PlayerPhysics>(); // Level will handle all level based actions, such as player death levelManager = FindObjectOfType<LevelManager>(); // Variable setup gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); canMove = false; atEdge = false; delay = 3; }
void OnTriggerStay(Collider _collider) { playerCollider = _collider; PlayerPhysics testPlayer = playerCollider.gameObject.GetComponent<PlayerPhysics>(); if (testPlayer) { playerPhysics = testPlayer; playerPhysics.pushPosition = Vector3.zero; CancelInvoke("pushIn"); Invoke("pushIn", 0.2f); } else Physics.IgnoreCollision(_sphereCollider, _collider); }
//private Animator animator; void Start() { playerPhysics = GetComponent<PlayerPhysics>(); //animator = GetComponent<Animator>(); sprite = GetComponentInChildren<Sprite>(); entity = GetComponentInChildren<Entity>(); lastVelocity = Vector3.zero; lastCheckpoint = transform.position; //animator.SetLayerWeight(1,1); base.Start(); }
// Use this for initialization void Start() { inventoryHashKey = "PlayerInventory"; object value = GameState.Instance.GetValue(inventoryHashKey); if (value != null) { inventory = (List<Pickup>)value; } else { inventory = new List<Pickup>(); GameState.Instance.AddObject(inventoryHashKey, inventory); } resourcesHashKey = "PlayerResources"; value = GameState.Instance.GetValue(resourcesHashKey); if (value != null) { resources = (Hashtable)value; } else { resources = new Hashtable(); GameState.Instance.AddObject(resourcesHashKey, resources); } playerPhysics = GetComponent<PlayerPhysics>(); spriteRenderer = renderer as SpriteRenderer;// GetComponent<SpriteRenderer>(); // spriteRenderer.animation.playAutomatically = true; amountToMove = Vector2.zero; }
// Use this for initialization void Start() { barLength = Screen.width/4; playerPhysics = GetComponent<PlayerPhysics>(); }
void Start() { amountToMove = new Vector2(); playerPhysics = GetComponent<PlayerPhysics>(); cameraFollow = Camera.main.GetComponent<CameraFollow>(); }
// Use this for initialization void Start() { CanBePushed=true; cantmove=false; Disguise = state.Idle; playerphysics=GetComponent<PlayerPhysics>(); }
void Start() { playerPhysics = transform.parent.gameObject.GetComponent<PlayerPhysics>(); }
private bool jump; // check if the player has jumped // Use this for initialization void Start () { playerPhysics = GetComponent<PlayerPhysics>(); }
// Use this for initialization void Awake() { playerPhysics = GetComponent<PlayerPhysics>(); fire = GetComponent<Fire>(); }
// New Commits void Start() { playerPhysics = GetComponent<PlayerPhysics> (); animator = GetComponent<Animator>(); }
// Use this for initialization void Start() { sprite = GetComponentInChildren<Sprite>(); controller = GetComponent<PlayerController>(); physics = GetComponent<PlayerPhysics>(); }
void Awake() { playerphysics = GetComponent<PlayerPhysics> (); //endGame = GetComponent<EndGame>(); }
// Use this for initialization void Start() { dead = Resources.Load("dead", typeof(Sprite)) as Sprite; physics = GetComponent<PlayerPhysics>(); }