Exemplo n.º 1
0
    // 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); };
    }
Exemplo n.º 2
0
        /// <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();
        }
Exemplo n.º 3
0
 void Start()
 {
     paintHandler = GameObject.FindGameObjectWithTag("PaintHandler").GetComponent <PaintHandler>();
     lastpos      = transform.position;
 }
Exemplo n.º 4
0
 void Start()
 {
     paintHandler = GameObject.FindGameObjectWithTag("PaintHandler").GetComponent <PaintHandler>();
     Destroy(gameObject, ttl);
 }