コード例 #1
0
        public void BuildPedestal(NodeAddedEvent e, BattleNode ctf, SingleNode <MapInstanceComponent> map, [Combine] FlagPedestalNode flagPedestal, [JoinByTeam] TeamNode teamNode)
        {
            CTFAssetProxyBehaviour        assetProxyBehaviour = GetAssetProxyBehaviour(ctf);
            FlagPedestalInstanceComponent component           = new FlagPedestalInstanceComponent {
                FlagPedestalInstance = Object.Instantiate <GameObject>((teamNode.colorInBattle.TeamColor != TeamColor.RED) ? assetProxyBehaviour.bluePedestal : assetProxyBehaviour.redPedestal, flagPedestal.flagPedestal.Position, Quaternion.identity)
            };

            flagPedestal.Entity.AddComponent(component);
        }
コード例 #2
0
        public void BuildFlag(NodeAddedEvent e, BattleNode ctf, SingleNode <MapInstanceComponent> map, [Combine] FlagNode flag, [JoinByTeam] TeamNode teamNode)
        {
            CTFAssetProxyBehaviour assetProxyBehaviour = GetAssetProxyBehaviour(ctf);
            TeamColor             teamColor            = teamNode.colorInBattle.TeamColor;
            GameObject            original             = (teamColor != TeamColor.RED) ? assetProxyBehaviour.blueFlag : assetProxyBehaviour.redFlag;
            GameObject            obj3      = (teamColor != TeamColor.RED) ? assetProxyBehaviour.blueFlagBeam : assetProxyBehaviour.redFlagBeam;
            FlagInstanceComponent component = new FlagInstanceComponent();
            GameObject            obj4      = Object.Instantiate <GameObject>(original, flag.flagPosition.Position, Quaternion.identity);

            component.FlagInstance = obj4;
            component.FlagBeam     = Object.Instantiate <GameObject>(obj3, obj4.transform, false);
            flag.Entity.AddComponent(component);
            obj4.AddComponent <FlagPhysicsBehaviour>().TriggerEntity = flag.Entity;
            flag.Entity.AddComponent(new FlagColliderComponent(obj4.GetComponent <BoxCollider>()));
        }