Пример #1
0
    byte error; //Error byte that can be checked with Unity documentation

    // Start is called before the first frame update
    void Start()
    {
        ObjectManager = FindObjectOfType <CheckMovingObjects>(); //Use this for transmission and recieving
                                                                 //initialise the server
        Clients = new List <int>();
        DontDestroyOnLoad(this);
        Player2.NTWK.ServerOwned = false;
        IPHolder IP = FindObjectOfType <IPHolder>();

        if (IP != null)
        {
            if (IP.IPAddress == "")
            {
                //Player1.Playing = true;
                Player1Proper.Player1    = true;
                Player2Proper.Player1    = false;
                Player1.NTWK.ServerOwned = true;
                Player2.NTWK.ServerOwned = false;
                ObjectManager.Hosting    = true;
                ObjectManager.Serv       = this;


                Init();
                SpawnObject(transform.position);
            }
            else
            {
                Player2Proper.Player1    = true;
                Player1Proper.Player1    = false;
                Player2.NTWK.ServerOwned = false;
            }
        }
    }
Пример #2
0
    void Start()
    {
        rigidBody = GetComponent <Rigidbody>();
        animator  = GetComponent <Animator>();
        movement  = GetComponent <characterMovement>();

        Check = FindObjectOfType <CheckMovingObjects>();
    }
Пример #3
0
    //bool CollidedThisLife = false;

    void Start()
    {
        timer          = 0;
        isReturning    = false;
        isStationary   = false;
        playerStartPos = owner.transform;
        rigidBody      = GetComponent <Rigidbody>();
        bmCollider     = GetComponent <CapsuleCollider>();
        throwScript    = owner.GetComponent <throwBoomerang>();
        Physics.IgnoreCollision(owner.GetComponent <CapsuleCollider>(), bmCollider);
        check = FindObjectOfType <CheckMovingObjects>();
    }
Пример #4
0
    void Start()
    {
        Check = FindObjectOfType <CheckMovingObjects>();

        if (Check.Hosting)
        {
            ActivePlayer = Player1;
        }
        else
        {
            ActivePlayer = Player2;
        }
    }
Пример #5
0
    public void Assign(int ID, GameObject SpawnedObject, CheckMovingObjects cc)
    {
        Checkmoving = cc;
        NetworkObjectScript tempy = new NetworkObjectScript();

        switch (ID)
        {
        case 0:
            tempy = SpawnedObject.AddComponent <FakeObjectType>().Obj;
            break;
        }


        Checkmoving.NetworkedObjects.Add(tempy);
    }
Пример #6
0
 // Start is called before the first frame update
 void Start()
 {
     check = FindObjectOfType <CheckMovingObjects>();
 }