/* * private void Update() { * if (Input.GetButtonUp("Ability") && !isHolding && delayTimer < FTDelay * && Form.FlameOn && Form.GetComponent<PlayerMovement>().GetGround) Fireball(); * * if (Input.GetButtonUp("Ability") && isHolding) StopFT(); * } */ public override void UseGroundAbility() { if (pStat.StaminaRef >= AbilityCost) { pStat.StaminaDeplete(AbilityCost); Form.GetComponent <Rigidbody2D>().velocity = Vector2.up * BurstFrc; } }
public RemotePlayerModel(ushort playerId) { // Spawn remote player model by cloning the player prefab and replacing local player script by remote player ones. string playerPrefabPath = LDB.players.Select(PLAYER_PROTO_ID).PrefabPath; if (playerPrefabPath != null) { PlayerTransform = Object.Instantiate(Resources.Load <Transform>(playerPrefabPath)); PlayerModelTransform = PlayerTransform.Find("Model"); // Remove local player components Object.Destroy(PlayerTransform.GetComponent <PlayerFootsteps>()); Object.Destroy(PlayerTransform.GetComponent <PlayerEffect>()); Object.Destroy(PlayerTransform.GetComponent <PlayerAudio>()); Object.Destroy(PlayerTransform.GetComponent <PlayerAnimator>()); Object.Destroy(PlayerTransform.GetComponent <PlayerController>()); PlayerTransform.GetComponent <Rigidbody>().isKinematic = true; // Add remote player components Movement = PlayerTransform.gameObject.AddComponent <RemotePlayerMovement>(); Animator = PlayerTransform.gameObject.AddComponent <RemotePlayerAnimation>(); } PlayerTransform.gameObject.name = $"Remote Player ({playerId})"; }
public RemotePlayerModel(ushort playerId, string username) { // Spawn remote player model by cloning the player prefab and replacing local player script by remote player ones. string playerPrefabPath = LDB.players.Select(PLAYER_PROTO_ID).PrefabPath; if (playerPrefabPath != null) { PlayerTransform = Object.Instantiate(Resources.Load <Transform>(playerPrefabPath)); PlayerModelTransform = PlayerTransform.Find("Model"); // Remove local player components Object.Destroy(PlayerTransform.GetComponent <PlayerFootsteps>()); Object.Destroy(PlayerTransform.GetComponent <PlayerEffect>()); Object.Destroy(PlayerTransform.GetComponent <PlayerAudio>()); Object.Destroy(PlayerTransform.GetComponent <PlayerAnimator>()); Object.Destroy(PlayerTransform.GetComponent <PlayerController>()); PlayerTransform.GetComponent <Rigidbody>().isKinematic = true; // Add remote player components Movement = PlayerTransform.gameObject.AddComponent <RemotePlayerMovement>(); Animator = PlayerTransform.gameObject.AddComponent <RemotePlayerAnimation>(); Effects = PlayerTransform.gameObject.AddComponent <RemotePlayerEffects>(); } PlayerTransform.gameObject.name = $"Remote Player ({playerId})"; PlayerInstance = new global::Player(); MechaInstance = new Mecha(); AccessTools.Property(typeof(global::Player), "mecha").SetValue(PlayerInstance, MechaInstance, null); MechaInstance.Init(PlayerInstance); //Fix MechaDroneRenderers AccessTools.Field(typeof(MechaDroneRenderer), "mat_0").SetValue(MechaInstance.droneRenderer, new Material(Configs.builtin.mechaDroneMat.shader)); Material mat = (Material)AccessTools.Field(typeof(MechaDroneRenderer), "mat_0").GetValue(MechaInstance.droneRenderer); MethodInvoker.GetHandler(AccessTools.Method(typeof(Material), "CopyPropertiesFromMaterial", new System.Type[] { typeof(Material) })).Invoke(mat, Configs.builtin.mechaDroneMat); PlayerId = playerId; Username = username; }
public override void Use() { PlayerTransform.GetComponent <PlayerControl.PlayerPickupUse>().PickupPutdown(); }
public override void Use() { PlayerTransform.GetComponent <PlayerControl.PlayerPickupUse>().PickupPutdown(); PickupItem.itemRigidbody.AddForce((CameraFocusTransform.rotation * throwForce), ForceMode.VelocityChange); StartCoroutine(CountDown()); }