Beispiel #1
0
        //private NavLinkProxyComponentInitializer Initializer;
        public override async System.Threading.Tasks.Task <bool> SetInitializer(CRenderContext rc, GamePlay.IEntity host, GamePlay.Component.IComponentContainer hostContainer, GComponentInitializer v)
        {
            if (!await base.SetInitializer(rc, host, hostContainer, v))
            {
                return(false);
            }

            if (mLineMeshComponent == null)
            {
                await InitGraphLines();
            }

            if (mLineMeshComponent != null)
            {
                mLineMeshComponent.Entity = host;

                Host.PlacementChange -= PlacementChange;
                Host.PlacementChange += PlacementChange;
                var mat = this.Host.Placement.WorldMatrix;
                mLineMeshComponent.OnUpdateDrawMatrix(ref mat);
            }

            var initializer = v as NavLinkProxyComponentInitializer;

            Radius    = initializer.Radius;
            Direction = initializer.Direction;

            Initializer = initializer;

            return(true);
        }
Beispiel #2
0
        public override async Task <bool> SetInitializer(CRenderContext rc, GamePlay.IEntity host, GamePlay.Component.IComponentContainer hostContainer, GComponentInitializer v)
        {
            if (!await base.SetInitializer(rc, host, hostContainer, v))
            {
                return(false);
            }

            Host.IsNavgation = true;

            return(true);
        }
Beispiel #3
0
        public override async Task <bool> SetInitializer(CRenderContext rc, GamePlay.IEntity host, GamePlay.Component.IComponentContainer hostContainer, GComponentInitializer v)
        {
            if (await base.SetInitializer(rc, host, hostContainer, v) == false)
            {
                return(false);
            }

            mMeshComponent = new GamePlay.Component.GMeshComponent();
            var meshCompInit = new GamePlay.Component.GMeshComponent.GMeshComponentInitializer();

            meshCompInit.SpecialName = "VisualMesh";
            meshCompInit.MeshName    = CEngineDesc.PlayerStartMesh;
            await mMeshComponent.SetInitializer(rc, Host, Host, meshCompInit);

            //var mat = host.Placement.WorldMatrix;
            //mMeshComponent.OnUpdateDrawMatrix(ref mat);

            AgentGeomBoxInitializer = v as AgentGeomBoxComponentInitializer;
            if (AgentGeomBoxInitializer != null)
            {
                AgentGridSize = AgentGeomBoxInitializer.AgentGridSize;
                StartPos      = AgentGeomBoxInitializer.StartPos;
            }
            else
            {
                AgentGeomBoxInitializer = new AgentGeomBoxComponentInitializer();
            }

            return(true);
        }
        public override async Task <bool> SetInitializer(CRenderContext rc, GamePlay.IEntity host, GamePlay.Component.IComponentContainer hostContainer, GComponentInitializer v)
        {
            if (!await base.SetInitializer(rc, host, hostContainer, v))
            {
                return(false);
            }

            if (mLineMeshComponent == null)
            {
                await base.InitDrawMesh();

                mLineMeshComponent.Entity = host;

                var mat = Host.Placement.WorldMatrix;
                mLineMeshComponent.OnUpdateDrawMatrix(ref mat);
            }

            return(true);
        }