I wish I wouldn’t have to make a bool from where I’m refering the bool in beginning
as if I make it in middle I can’t have it true if mouse down as it’ll make it false next frame
OR bool won’t be assigned
and in structure it doesn’t work too since I must not assign them in beginning as in code the commented one
and I don’t want to change it to a Class
is there anykind of solution or I must necessarily instantiate it in beginning for a structure
using UnityEngine;
using System.Collections;
public struct ResizeWindow {
// public bool Resize = false;
public void ResizeF (ref bool Resize, ref Rect ResizingWindow){
if (Event.current.type.ToString() == "mouseDown"){
Resize = true;
}
if (Resize){
ResizingWindow = new Rect (0,0,Event.current.mousePosition.x + 1,Screen.height/3);
Debug.Log("sdpiorghn");
if (Event.current.type.ToString() == "mouseUp"){
Resize = false;
}
}
}
}
OR how would I create it false when I instantiate this structure?
ResizeWindow Resize.Resize = false;
or
ResizeWindow Resize = new ResizeWindow (Resize = false);
or something like that
so when it’s created I automatically
if that’s not possible just let me know
OR how would I do something that GUI.Dragwindow has? so I wouldn’t need to instantiate stuff or ref or pass values
thanks in advance