This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using UnityEngine; | |
| public class TogglePin : MonoBehaviour | |
| { | |
| private int index; | |
| private string[] commands = new[] { "pin=ON1", "pin=OFF1" }; | |
| public void Click() | |
| { | |
| string url = "http://192.168.4.1?" + commands[index]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| // Add this MonoBehaviour to anything on the scene and it will create a prototype comet moving around a pivot | |
| public class LerpEllipseExample : MonoBehaviour | |
| { | |
| // These are 'a' and 'b' in the ellipse formula, think aphelion and perihelion | |
| float trajectoryHeight = 4; // y | |
| float trajectoryWidth = 12; // x | |
| float timeItTakesToGoAroundTheSun = 6; // 6 seconds, pretty fast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function love.load() | |
| -- Comet, is going to move around the Sun | |
| comet = {} | |
| comet.x = 0 | |
| comet.y = 0 | |
| -- These are 'a' and 'b' in the ellipse formula, think aphelion and perihelion | |
| comet.trajectoryHeight = 40 | |
| comet.trajectoryWidth = 120 | |
| comet.timeItTakesToGoAroundTheSun = 3 -- 3 seconds, pretty fast | |
| comet.timeSinceBeginning = 0 |
NewerOlder