// float nextColor = 0; void Start() { cam = Camera.main.transform; paintHandler = GameObject.FindGameObjectWithTag("PaintHandler").GetComponent <PaintHandler>(); paintBottle.SetColor(paintHandler.GetColor(colorIndx)); shootBtn.asset.Enable(); shootBtn.action.performed += c => { inputShooting = true; }; shootBtn.action.canceled += c => { inputShooting = false; }; prevColorBtn.action.performed += c => { PrevPaintColor(); }; nextColorBtn.action.performed += c => { NextPaintColor(); }; triggerValue.action.performed += c => { if (Time.timeScale == 0) { gunAimGO.SetActive(false); return; } if (c.ReadValue <float>() > 0.1f) { gunAimGO.SetActive(true); } else { gunAimGO.SetActive(false); } }; triggerValue.action.canceled += c => { gunAimGO.SetActive(false); }; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { zoneContent = new ContentManager(Content.ServiceProvider, Content.RootDirectory); game = new GameInit(); contentHandler = new ContentHandler(zoneContent); keyHandler = new KeyHandler(); logicHandler = new LogicHandler(); paintHandler = new PaintHandler(); base.Initialize(); }
void Start() { paintHandler = GameObject.FindGameObjectWithTag("PaintHandler").GetComponent <PaintHandler>(); lastpos = transform.position; }
void Start() { paintHandler = GameObject.FindGameObjectWithTag("PaintHandler").GetComponent <PaintHandler>(); Destroy(gameObject, ttl); }