Example #1
0
 public void CmdSetColor(int team, Vector2 pixelV)
 {
     Debug.Log("Got Comamnd for pixel!" + team + pixelV);
     if (isServer)
     {
         if (!sph)
         {
             sph = GameObject.FindGameObjectWithTag("neededStuff").GetComponent <ServerPixelHandler> ();
         }
         if (sph)
         {
             sph.SetColorFor(pixelV, team);
         }
     }
 }
Example #2
0
    void Update()
    {
        if (SPH == null)
        {
            GameObject SPHGO = GameObject.FindGameObjectWithTag("neededStuff");
            if (SPHGO)
            {
                SPH = SPHGO.GetComponent <ServerPixelHandler>();
                SPH.RegisterPixelWithManager(this);
            }
        }
        //switch color based on the

        if (lastteam != team)
        {
            ChangeColorToNewTeam(team);
            lastteam = team;
        }
    }