コード例 #1
0
    public override void ServerAndClientJoinedGame()
    {
        base.ServerAndClientJoinedGame();

        iconUnit = Instantiate(unitPrefab).GetComponent <GameUnit>();
        iconUnit.BecomeIcon();

        iconObject = iconUnit.gameObject;
        iconObject.transform.SetParent(transform);
        iconObject.transform.localPosition = new Vector3(0f, iconPlacement.transform.position.y, 0f);
        iconObject.transform.localRotation = Quaternion.identity;
        player.Paint(iconObject);

        keyIcon.EachRenderer(r => r.enabled = true);

        gameObject.name = "Tower Player" + player.playerNumber + " " + unitPrefab.name;
        if (player.inputs.LastInputType == BindingSourceType.None)
        {
            player.inputs.LastInputType = BindingSourceType.KeyBindingSource;
        }

        HideMesh();

        if (isWarpedIn)
        {
            IsWarpedInChanged();
        }
        else
        {
            gameUnitState.AddCallback("isWarpedIn", IsWarpedInChanged);
        }
    }