public static void CreateBulletParamAsset() { BulletParams bp = ScriptableObject.CreateInstance <BulletParams>(); string path = AssetDatabase.GenerateUniqueAssetPath("Assets/ScriptableObjects/MyFirstBullet.asset"); AssetDatabase.CreateAsset(bp, path); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
public void ApplyParameters(BulletParams bp) { if (self != null) { emitter.amplitudeAngle = bp.amplitudeAngle; emitter.numberOfSimultaneousBullets = bp.numberOfSimultaneousBullets; emitter.firingRate = bp.firingRate; currentParams = bp; spriteRenderer.color = bp.color; self.localScale = Vector3.one * bp.size; } }
public void MoveBullet(string id, string bt, Vector3 pos, bool isExp) { var obj = new BulletParams(id, bt, pos, isExp); socket.Emit("BULLET_MOVE", JSONObject.Create(JsonUtility.ToJson(obj))); }
public void InstantiatePlayerBullet(string id, string bt, Vector3 pos, bool isExp) { var obj = new BulletParams(id, bt, pos, isExp); socket.Emit("BULLET_INSTANTIATED", JSONObject.Create(JsonUtility.ToJson(obj))); }