update
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public partial class DirectionalLight : EnvironmentObject
|
||||
{
|
||||
[SerializeField]
|
||||
private Light directionalLight;
|
||||
|
||||
public float intensity;
|
||||
public bool castShadows;
|
||||
|
||||
public static DirectionalLight GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName,
|
||||
bool isStatic, float intensity, bool castShadows)
|
||||
{
|
||||
DirectionalLight dirLight = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DirectionalLight>();
|
||||
|
||||
dirLight.intensity = intensity;
|
||||
dirLight.castShadows = castShadows;
|
||||
return dirLight;
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
directionalLight.color = colorSubmodule.currentBaseColor;
|
||||
directionalLight.intensity = intensity;
|
||||
directionalLight.shadows = castShadows ? LightShadows.Soft : LightShadows.None;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class DirectionalLight
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DirectionalLight_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic, intensity, castShadows);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class DirectionalLight_BM : EnvironmentObject_BM
|
||||
{
|
||||
public float intensity;
|
||||
public bool castShadows;
|
||||
|
||||
public DirectionalLight_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DirectionalLight_BM(string elementName, Guid id, List<string> tags,
|
||||
GameElement_BM parent, string themeBundleName, string objectName, bool isStatic,
|
||||
float intensity, bool castShadows) :
|
||||
base(elementName, id, tags, parent, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
this.intensity = intensity;
|
||||
this.castShadows = castShadows;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = DirectionalLight.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName, isStatic, intensity, castShadows);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return DirectionalLight.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent, themeBundleName, objectName, isStatic, intensity, castShadows);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d3011bfdcb00476fbd1a7de86d1c1cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public class JudgeTrigger : EnvironmentObject, IHaveNoteJudgeTriggerSubmodule
|
||||
{
|
||||
public SpriteRenderer triggerSprite;
|
||||
public Collider triggerCollider;
|
||||
public NoteJudgeTriggerSubmodule noteJudgeTriggerSubmodule { get; set; }
|
||||
|
||||
public static JudgeTrigger GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName, bool isStatic)
|
||||
{
|
||||
JudgeTrigger judgeTrigger = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<JudgeTrigger>();
|
||||
return judgeTrigger;
|
||||
}
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
base.SetDefaultSubmodules();
|
||||
noteJudgeTriggerSubmodule = new NoteJudgeTriggerSubmodule(this);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
triggerSprite.color = IsMouseOver() ? Color.red : Color.white;
|
||||
}
|
||||
|
||||
private bool IsMouseOver()
|
||||
{
|
||||
//Raycast to check if mouse is over the object
|
||||
Ray ray = GameManager.instance.cameraManager.gameCamera.gameCamera.ScreenPointToRay(Mouse.current.position.ReadValue());
|
||||
if (Physics.Raycast(ray, out RaycastHit hit))
|
||||
{
|
||||
if (hit.collider == triggerCollider)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class JudgeTrigger_BM : EnvironmentObject_BM
|
||||
{
|
||||
public JudgeTrigger_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public JudgeTrigger_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
GameElement_BM parentElement, string themeBundleName, string objectName, bool isStatic) :
|
||||
base(elementName, elementGuid, tags, parentElement, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = JudgeTrigger.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName, isStatic);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return JudgeTrigger.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent, themeBundleName, objectName, isStatic);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a7a990728bad4e9ba201e72267e7eca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public partial class PointLight : EnvironmentObject
|
||||
{
|
||||
[SerializeField]
|
||||
private Light pointLight;
|
||||
|
||||
public float intensity;
|
||||
public float range;
|
||||
public bool castShadows;
|
||||
|
||||
public static PointLight GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName,
|
||||
bool isStatic, float intensity, float range, bool castShadows)
|
||||
{
|
||||
PointLight poLight = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<PointLight>();
|
||||
|
||||
poLight.intensity = intensity;
|
||||
poLight.range = range;
|
||||
poLight.castShadows = castShadows;
|
||||
return poLight;
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
pointLight.color = colorSubmodule.currentBaseColor;
|
||||
pointLight.intensity = intensity;
|
||||
pointLight.range = range;
|
||||
pointLight.shadows = castShadows ? LightShadows.Soft : LightShadows.None;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class PointLight
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new PointLight_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic, intensity, range, castShadows);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class PointLight_BM : EnvironmentObject_BM
|
||||
{
|
||||
public float intensity;
|
||||
public float range;
|
||||
public bool castShadows;
|
||||
|
||||
public PointLight_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PointLight_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM parentElement,
|
||||
string themeBundleName, string objectName, bool isStatic, float intensity, float range, bool castShadows)
|
||||
: base(elementName, elementGuid, tags, parentElement, themeBundleName, objectName, isStatic)
|
||||
{
|
||||
this.intensity = intensity;
|
||||
this.range = range;
|
||||
this.castShadows = castShadows;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = PointLight.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName, isStatic, intensity, range, castShadows);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return PointLight.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent, themeBundleName, objectName, isStatic, intensity, range, castShadows);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e32cd989d5ff4f52b2b9ca2436698e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user