Commit ffb49cf9 authored by hex's avatar hex

fix lighting and mouseParticle

parent 68130274
Pipeline #39657 failed
using System.Collections; using UnityEngine;
using UnityEngine;
public class mouseParticle : MonoBehaviour public class mouseParticle : MonoBehaviour
{ {
public Camera camera; public Camera camera;
public ParticleSystem e1;
public ParticleSystem e2;
public Transform trans; public Transform trans;
private float time = 0;
// Use this for initialization // Use this for initialization
void Start() private void Start()
{ {
camera.depth = 99999; camera.depth = 99999;
} }
float time = 0;
// Update is called once per frame // Update is called once per frame
void Update() private void Update()
{ {
Vector3 screenPoint = Input.mousePosition; var screenPoint = Input.mousePosition;
screenPoint.z = 10; screenPoint.z = 10;
trans.position = camera.ScreenToWorldPoint(screenPoint); trans.position = camera.ScreenToWorldPoint(screenPoint);
if (Input.GetMouseButton(0)) if (Input.GetMouseButtonDown(0))
{ {
if (Input.GetMouseButtonDown(0)) e1.Play();
{ e2.Play();
time = 0;
}
time += Time.deltaTime;
if (time > 0.49)
{
time = 0.49f;
}
} }
else
if (Input.GetMouseButtonUp(0))
{ {
e1.Stop();
e2.Stop();
} }
} }
} }
\ No newline at end of file
...@@ -657,7 +657,7 @@ public class Program : MonoBehaviour ...@@ -657,7 +657,7 @@ public class Program : MonoBehaviour
File.Move(newfile, oldfile); File.Move(newfile, oldfile);
} }
// public GameObject mouseParticle; public GameObject mouseParticle;
static int lastChargeTime = 0; static int lastChargeTime = 0;
...@@ -1241,7 +1241,7 @@ public class Program : MonoBehaviour ...@@ -1241,7 +1241,7 @@ public class Program : MonoBehaviour
Screen.autorotateToPortraitUpsideDown = false; Screen.autorotateToPortraitUpsideDown = false;
#endif #endif
// 移动端不需要初始化鼠标特效 // 移动端不需要初始化鼠标特效
// mouseParticle = Instantiate(new_mouse); mouseParticle = Instantiate(new_mouse);
instance = this; instance = this;
Initialize(); Initialize();
go( go(
......
...@@ -152,7 +152,7 @@ public class Setting : WindowServant2D ...@@ -152,7 +152,7 @@ public class Setting : WindowServant2D
public void onchangeMouse() public void onchangeMouse()
{ {
// Program.I().mouseParticle.SetActive(setting.mouseEffect.value); Program.I().mouseParticle.SetActive(setting.mouseEffect.value);
} }
//private int dontResizeTwice = 2; //private int dontResizeTwice = 2;
......
using UnityEngine; using System;
using System.Collections; using System.Collections;
using System; using UnityEngine;
public class fusion_tweener : MonoBehaviour { public class fusion_tweener : MonoBehaviour
{
// ParticleEmitter[] emitters; // ParticleEmitter[] emitters;
// ParticleAnimator[] animators; // ParticleAnimator[] animators;
ParticleSystem[] systems; ParticleSystem[] systems;
// Use this for initialization // Use this for initialization
void Start () { void Start()
{
// emitters = GetComponentsInChildren<ParticleEmitter>(); // emitters = GetComponentsInChildren<ParticleEmitter>();
// animators = GetComponentsInChildren<ParticleAnimator>(); // animators = GetComponentsInChildren<ParticleAnimator>();
systems = GetComponentsInChildren<ParticleSystem>(); systems = GetComponentsInChildren<ParticleSystem>();
...@@ -34,11 +36,11 @@ public class fusion_tweener : MonoBehaviour { ...@@ -34,11 +36,11 @@ public class fusion_tweener : MonoBehaviour {
// animator.force *= scaleFactor; // animator.force *= scaleFactor;
// animator.rndForce *= scaleFactor; // animator.rndForce *= scaleFactor;
// } // }
} }
int step = 1; int step = 1;
float scaleFactor = 0.1f; float scaleFactor = 0.1f;
int start_time = 0; int start_time = 0;
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (Program.TimePassed() - start_time > 0) if (Program.TimePassed() - start_time > 0)
...@@ -60,7 +62,7 @@ public class fusion_tweener : MonoBehaviour { ...@@ -60,7 +62,7 @@ public class fusion_tweener : MonoBehaviour {
if (step == 1) if (step == 1)
{ {
scaleFactor = 1 + Time.deltaTime*1.5f; scaleFactor = 1 + Time.deltaTime * 1.5f;
} }
if (step == 2) if (step == 2)
{ {
......
...@@ -4984,7 +4984,7 @@ Transform: ...@@ -4984,7 +4984,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 126222} m_GameObject: {fileID: 126222}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.32103002, y: 0, z: 6.71785} m_LocalPosition: {x: -0.27, y: 0, z: 5.65}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment