// Use this for initialization void Start() { player = GameObject.FindWithTag("player"); barObject = GameObject.FindWithTag ("barObject"); playerPhysics = player.GetComponent<PlayerPhysics>(); bar = barObject.GetComponent<bar>(); }
/// <summary> /// This is a javascript application. /// </summary> /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param> public Application(IApp page) { var bar_script = new bar().Content; bar_script.onload += delegate { Console.WriteLine("at new bar().Content.onload"); dynamic window = Native.Window; Action bar = () => { IFunction f = window.bar; f.apply(Native.Window); }; new IHTMLButton { innerText = "bar" }.AttachToDocument().onclick += delegate { bar(); }; }; bar_script.AttachToDocument(); }
static bar initObject(WebGLRenderingContext gl, Action callback) { var data = new data { vertices = new float[] { }, indices = new ushort[] { }, uvs = new float[] { } }; createRectangle(2, data); var @object = new bar(); @object.vertex_buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, @object.vertex_buffer); gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray(data.vertices), gl.STATIC_DRAW); @object.index_buffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, @object.index_buffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray(data.indices), gl.STATIC_DRAW); @object.texturecoord_buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, @object.texturecoord_buffer); gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray(data.uvs), gl.STATIC_DRAW); @object.n_elements = data.indices.Length; @object.t["texture1"] = loadTexture(gl, new texture1().src, callback); @object.t["texture2"] = loadTexture(gl, new texture2().src, callback); @object.t["texture3"] = loadTexture(gl, new texture3().src, callback); @object.t["texture4"] = loadTexture(gl, new texture4().src, callback); @object.t["texture5"] = loadTexture(gl, new texture5().src, callback); @object.t["texture6"] = loadTexture(gl, new texture6().src, callback); return(@object); }
static void Main(string[] args) { var b = new bar(); var a = b.buzz().fizz(x => x.name).buzz().fizz(); Console.ReadLine(); }
void Start() { rb = GetComponent <Rigidbody2D>(); playerAnimation = GetComponent <Animator>(); gameLevelManager = FindObjectOfType <LevelManager>(); bar = FindObjectOfType <bar>(); }
static void Main() { bar Bar = new bar(); baz Baz = new baz(); System.Console.WriteLine( "We have {0} bars, rejoice!", bar.Cache.Count); }
void Start() { countdown=0.0f; countdownc=Random.Range(0,3); rend=gameObject.GetComponent<SpriteRenderer>(); cube=GameObject.FindGameObjectWithTag("energy"); bar1=cube.GetComponent<bar>(); }
public void ParseAttr() { bar b = EnumParser.Parse <bar>("moo"); Assert.AreEqual(bar.bloo, b); b = EnumParser.Parse <bar>("bloo"); Assert.AreEqual(bar.bloo, b); }
public void Null() { string s = EnumParser.ToString(foo.NONE); Assert.IsNull(s); foo f = EnumParser.Parse <foo>(""); Assert.AreEqual(foo.NONE, f); bar b = EnumParser.Parse <bar>(""); Assert.AreEqual(bar.goo, b); }
void InitiateBuffers() { bar[] values = new bar[WIDTH*HEIGHT]; for(int i=0; i < WIDTH*HEIGHT; ++i) { values[i].Position = 5.0f; values[i].Velocity = 0.0f; values[i].h = 1.0f; } // Debug.Log(Marshal.SizeOf(bar)); _BarBuffer = new ComputeBuffer(WIDTH*HEIGHT, sizeof(float)*3); _BarBuffer.SetData(values); }
public static void Main() { foo a = new foo(); bar b = new bar(); a.x = 1; b.x = 1; foo a2 = a; bar b2 = b; a.x = 2; b.x = 2; Console.WriteLine("a2.x == {0}", a2.x); Console.WriteLine("b2.x == {0}", b2.x); }
public void UpdataUIStatus(bar barstr) { if (InvokeRequired) { this.Invoke(new AsynUpdateUI(delegate(bar s) { this.progressBar1.Maximum = s.maxstep; this.progressBar1.Value = s.step; this.labWorking.Text = s.str + " " + s.step.ToString() + "/" + s.maxstep.ToString(); }), barstr); } else { this.progressBar1.Minimum = 0; this.progressBar1.Maximum = barstr.maxstep; this.progressBar1.Value = barstr.step; this.labWorking.Text = barstr.str + " " + barstr.step.ToString() + "/" + barstr.maxstep.ToString(); } }
void drawObject(WebGLRenderingContext gl, foo shader, bar @object) { gl.useProgram(shader.program); gl.bindBuffer(gl.ARRAY_BUFFER, @object.vertex_buffer); gl.vertexAttribPointer((uint)shader.aVertexPosition, 3, gl.FLOAT, false, 0, 0); gl.bindBuffer(gl.ARRAY_BUFFER, @object.texturecoord_buffer); gl.vertexAttribPointer((uint)shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture1"]); gl.uniform1i(shader.u["uSamplerDiffuse1"], 0); gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture2"]); gl.uniform1i(shader.u["uSamplerDiffuse2"], 1); gl.activeTexture(gl.TEXTURE2); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture3"]); gl.uniform1i(shader.u["uSamplerDiffuse3"], 2); gl.activeTexture(gl.TEXTURE3); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture4"]); gl.uniform1i(shader.u["uSamplerDiffuse4"], 3); gl.activeTexture(gl.TEXTURE4); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture5"]); gl.uniform1i(shader.u["uSamplerDiffuse5"], 4); gl.activeTexture(gl.TEXTURE5); gl.bindTexture(gl.TEXTURE_2D, @object.t["texture6"]); gl.uniform1i(shader.u["uSamplerDiffuse6"], 5); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, @object.index_buffer); gl.uniformMatrix4fv(shader.u["uProjectionMatrix"], false, shader.PROJECTION_MATRIX); gl.uniformMatrix4fv(shader.u["uModelViewMatrix"], false, shader.MV_MATRIX); gl.drawElements(gl.TRIANGLES, @object.n_elements, gl.UNSIGNED_SHORT, 0); }
// Use this for initialization void Start() { cam = Camera.main; rb = GetComponent <Rigidbody2D>(); if (energyBar == null) { energyBar = GameObject.Find("energyBar").GetComponent <bar>(); } if (attractorMassBar == null) { attractorMassBar = GameObject.Find("energyUsageBar").GetComponent <bar>(); } if (healthBar == null) { healthBar = GameObject.Find("healthBar").GetComponent <bar>(); } energyBar.changeValue(energy, MaxEnergy); attractorMassBar.changeValue(attractorMass, MaxAttractorMass); healthBar.changeValue(health, MaxHealth); numberText = GameObject.Find("attractorMass").GetComponent <TextMeshProUGUI>(); }
// Use this for initialization void Start() { playerPhysics = GetComponent<PlayerPhysics>(); bar = GetComponent<bar>(); }
void renderFrame(WebGLRenderingContext gl, foo shader, bar @object) { gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); drawObject(gl, shader, @object); }
public void DoBar(bar pbar) { this._pbar = pbar; }
public static string doSomething( bar b) { return b.a; }
public foo(bar bar) { this._bar = bar; }
public void DoFoo(foo pfoo, [Inject(typeof(bar))] bar pbar) { }
public foo(bar barAsParameter) { }
static void Main () { bar b = new bar (); b [0].x = 5; }
static void Main() { bar b = new bar(); b [0].x = 5; }
public string doSomething(bar b) { return(b.a); }
static void Main () { bar b = new bar (); baz (out b [0].x); }
public foo item; // yes I'm a public field public bool Predicate(bar x) { return(x.prop1 == item.A && x.prop2 == item.B); }
public static int Main() { bar <T> b = new bar <T>(); return(b.test(new T(1, 2, 3))); }
static void Main() { bar b = new bar(); baz(out b [0].x); }
static bar initObject(WebGLRenderingContext gl, Action callback) { var data = new data { vertices = new float[] { }, indices = new ushort[] { }, uvs = new float[] { } }; createRectangle(2, data); var @object = new bar(); @object.vertex_buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, @object.vertex_buffer); gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray(data.vertices), gl.STATIC_DRAW); @object.index_buffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, @object.index_buffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray(data.indices), gl.STATIC_DRAW); @object.texturecoord_buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, @object.texturecoord_buffer); gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray(data.uvs), gl.STATIC_DRAW); @object.n_elements = data.indices.Length; @object.t["texture1"] = loadTexture(gl, new texture1().src, callback); @object.t["texture2"] = loadTexture(gl, new texture2().src, callback); @object.t["texture3"] = loadTexture(gl, new texture3().src, callback); @object.t["texture4"] = loadTexture(gl, new texture4().src, callback); @object.t["texture5"] = loadTexture(gl, new texture5().src, callback); @object.t["texture6"] = loadTexture(gl, new texture6().src, callback); return @object; }
void Start() { cube=GameObject.FindGameObjectWithTag("energy"); bar1=cube.GetComponent<bar>(); }
public foo(bar b) { }