示例#1
0
    void Start()
    {
        // Random Number
        randomNumber = Random.Range(0f,3.0f);

        // Get Path
        if(randomNumber <= 1f){
            pathPoint = GameObject.Find("Path_1");
        }

         	if(randomNumber >= 1.0f && randomNumber <= 2.0f){
            pathPoint = GameObject.Find("Path_2");
        }

        if(randomNumber > 2.0f){
            pathPoint = GameObject.Find("Path_3");
        }

        // Load GameObjects
        spawner = GameObject.FindGameObjectWithTag("Spawner");
        view = GameObject.FindGameObjectWithTag("View");

        // Load Scripts
        viewScript = view.GetComponent<ViewScript>();
        wave = spawner.gameObject.GetComponent<WaveSysteem>();
        varW = pathPoint.gameObject.GetComponent<WaypointPath>();
    }
示例#2
0
 public void Front(ViewScript view)
 {
     if (view.GetLayerIndex() != layerIndex)
     {
         AddChild(view);
         UIPanel.SetDirty();
     }
 }
    // Use this for initialization
    void Start()
    {
        model    = gameObject.AddComponent <ModelScript>();
        view     = gameObject.AddComponent <ViewScript>();
        soundScr = gameObject.AddComponent <SoundScript>();

        Invoke("SetUpGame", 0.1f);
    }
示例#4
0
 public void AddChild(ViewScript view)
 {
     if (viewList.Contains(view))
     {
         viewList.Remove(view);
     }
     viewList.Add(view);
     view.SetLayerIndex(++layerIndex);
 }
示例#5
0
    private ViewScript viewScript;   // to get a non-static reference to the ViewScript Object

    // Use this for initialization
    void Start()
    {
        viewScript                     = (ViewScript)combatScripts.GetComponent("ViewScript"); // to get a non-static reference to the ViewScript Object
        PlayerStatus.AmmoCount         = 10;                                                   // DEBUG CODE REMOVE IN MVP
        PlayerStatus.ShipHealthMax     = 100;                                                  // DEBUG CODE REMOVE IN MVP
        PlayerStatus.ShipHealthCurrent = 100;                                                  // DEBUG CODE REMOVE IN MVP

        EnemyStatus.ShipHealthMax     = 50;
        EnemyStatus.ShipHealthCurrent = 50;
        EnemyStatus.AmmoCount         = 10;
    }
示例#6
0
        /// <summary>
        /// Charger un script
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listActions_SelectedIndexChanged(object sender, EventArgs e)
        {
            VO_ActionOnItemScript actionScript = CurrentItem.Scripts.Find(p => p.Id == ((VO_Base)listActions.SelectedItem).Id);

            if (actionScript == null)
            {
                actionScript = new VO_ActionOnItemScript(((VO_Base)listActions.SelectedItem).Id, ObjectsFactory.CreateScript(Enums.ScriptType.ItemEvents));
                CurrentItem.Scripts.Add(actionScript);
            }
            ViewScript.LoadScript(actionScript.Script);
        }
示例#7
0
    // Use this for initialization
    void Start()
    {
        // to get a non-static reference to the ViewScript Object
        UI = (ViewScript)UIScripts.GetComponent("ViewScript");
        //Find and adds objects with the tag "Enemy" and "Player"
        enemy.AddRange(GameObject.FindGameObjectsWithTag("Enemy"));
        player.AddRange(GameObject.FindGameObjectsWithTag("Player"));

        // establish that combat is NOT over, and that the player has NOT won
        combatOver = false;
        playerWon  = false;
    }
示例#8
0
        public string GenearteViewScripts(ViewScript script)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"CREATE VIEW {script.FullName} AS");

            foreach (Statement statement in script.Statements)
            {
                sb.AppendLine(this.BuildStatement(statement));
            }

            return(this.FormatScripts(sb.ToString()));
        }
示例#9
0
        public override AnalyseResult AnalyseView(string content)
        {
            SqlSyntaxError error = null;

            DdlStatementContext ddlStatement = this.GetDdlStatementContext(content, out error);

            AnalyseResult result = new AnalyseResult()
            {
                Error = error
            };

            if (!result.HasError && ddlStatement != null)
            {
                ViewScript script = new ViewScript();

                CreateViewContext view = ddlStatement.createView();

                if (view != null)
                {
                    #region Name
                    this.SetScriptName(script, view.fullId());
                    #endregion

                    #region Statement

                    foreach (var child in view.children)
                    {
                        if (child is SimpleSelectContext select)
                        {
                            script.Statements.Add(this.ParseSelectStatement(select));
                        }
                    }

                    #endregion
                }

                this.ExtractFunctions(script, ddlStatement);

                result.Script = script;
            }

            return(result);
        }
示例#10
0
    public void Initialize()
    {
        model      = this.transform.Find("Model").gameObject.GetComponent <ModelScript>(); // Nice Unity object referencing
        view       = this.transform.Find("View").gameObject.GetComponent <ViewScript>();
        controller = this.transform.Find("Controller").gameObject.GetComponent <ControllerScript>();

        if (model == null)
        {
            throw new KeyNotFoundException("Failed to assign \"ModelScript\"");
        }
        if (view == null)
        {
            throw new KeyNotFoundException("Failed to assign \"ViewScript\"");
        }
        if (controller == null)
        {
            throw new KeyNotFoundException("Failed to assign \"ControllerScript\"");
        }

        DoBindings();
    }
示例#11
0
    void Start()
    {
        functionList["particle"]   = false;
        functionList["facial"]     = false;
        functionList["model"]      = true;
        functionList["animation"]  = true;
        functionList["background"] = true;
        functionList["lod"]        = true;

        functionList["position_x"]      = false;
        functionList["position_y"]      = false;
        functionList["position_z"]      = false;
        functionList["rotate"]          = false;
        functionList["animation_speed"] = true;



        viewCam  = GameObject.Find("Main Camera").GetComponent <ViewScript>();
        planeObj = GameObject.Find("Plane") as GameObject;

        txt            = Resources.Load <TextAsset>(viewerSettingPath + "/background_list");
        backGroundList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

        txt       = Resources.Load <TextAsset>(viewerSettingPath + "/" + FBXListFile);
        modelList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

        txt          = Resources.Load <TextAsset>(viewerSettingPath + "/stage_texture_list");
        stageTexList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

        if (functionList["particle"])
        {
            txt          = Resources.Load <TextAsset>(viewerSettingPath + "/" + ParticleListFile);
            particleList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

            txt = Resources.Load <TextAsset>(viewerSettingPath + "/" + ParticleAnimationListFile);
            particleAnimationList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
        }

        txt = Resources.Load <TextAsset>(viewerSettingPath + "/" + AnimationListFile);
        animationCommonList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

        if (functionList["facial"])
        {
            txt           = Resources.Load <TextAsset>(viewerSettingPath + "/" + FacialTexListFile);
            facialTexList = txt.text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
        }

        txt       = Resources.Load <TextAsset>(viewerSettingPath + "/" + TitleTextFile);
        titleText = txt.text;

        txt  = Resources.Load <TextAsset>(viewerSettingPath + "/fbx_ctrl");
        xDoc = new XmlDocument();
        xDoc.LoadXml(txt.text);

        //FaceMaterial

        /*
         *
         * if(resourcesPath == "Arum"){
         *  faceObjName = "succubus_a";
         *  faceMat_L = Resources.Load( viewerMaterialPath + "/succubus_a_face_l", Material);
         *  faceMat_M = Resources.Load( viewerMaterialPath + "/succubus_a_face_m", Material);
         *
         * }else if(resourcesPath == "Asphodel"){
         *  faceObjName = "succubus_b";
         *  faceMat_L = Resources.Load( viewerMaterialPath + "/succubus_b_face_l", Material);
         *  faceMat_M = Resources.Load( viewerMaterialPath + "/succubus_b_face_m", Material);
         * }
         */

        faceMat_L = facialMaterial_L_org;
        faceMat_M = facialMaterial_M_org;


        if (curMode == 0)
        {
            animationList = particleAnimationList;
        }
        else if (curMode == 1)
        {
            animationList = animationCommonList;
        }

        curModeName = modeTextList[curMode];

        /* Succubus Pack
         * BGObject = GameObject.Find("obj01_succubus_pedestal_00");
         * BGEff    = GameObject.Find("eff_obj01_00");
         * BGPlane  = GameObject.Find("Plane");
         */

        SetInitBackGround();
        SetInitModel();
        SetInitMotion();
        SetAnimationSpeed(animSpeed);

        // Succubus
        // SetInitFacial();

        if (curMode == 0)
        {
            this.SetInitParticle();
        }
    }
示例#12
0
    void Start()
    {
        //get the navmesh agent
        m_agent = GetComponent <UnityEngine.AI.NavMeshAgent>();
        m_gun   = GetComponentsInChildren <Gun>();
        int gunCount = 0;

        foreach (Gun gun in m_gun)
        {
            gun.SetOwner(transform);
            origPos[gunCount] = gun.transform.position;
            origRot[gunCount] = gun.transform.rotation;
            gunCount++;
        }
        m_monitor = GetComponentInChildren <ViewScript>();

        m_target      = null;
        m_covertarget = null;

        //get the view cone, the legs and the guns
        foreach (Transform child in gameObject.GetComponentsInChildren <Transform>())
        {
            if (child.gameObject.tag == "ViewCone")
            {
                m_view = child;
            }
            if (child.gameObject.tag == "LeftLeg")
            {
                leftLeg = child;
            }
            if (child.gameObject.tag == "RightLeg")
            {
                rightLeg = child;
            }
            if (child.gameObject.name == "CrouchLegs")
            {
                crouchLegs = child;
            }
            if (child.gameObject.name == "RifleArms")
            {
                arms[1] = child.gameObject;
            }
            if (child.gameObject.name == "PistolArms")
            {
                arms[0] = child.gameObject;
            }
            if (child.gameObject.name == "RifleHolster")
            {
                rifleHolster = child;
            }
            if (child.gameObject.name == "PistolHolster")
            {
                pistolHolster = child;
            }
            if (child.gameObject.name == "Selected")
            {
                selected = child;
            }
            if (child.gameObject.name == "InnerRing")
            {
                innerRing = child;
            }
            if (child.gameObject.name == "OuterRing")
            {
                outerRing = child;
            }
        }

        selected.gameObject.SetActive(false);

        //hide the set of arms not being used
        arms[gunOut].SetActive(true);
        arms[(1 - gunOut)].SetActive(false);

        //hide crouch legs
        crouchLegs.gameObject.SetActive(false);

        if (gunOut == 1)
        {
            m_gun[0].gameObject.transform.position = pistolHolster.position;
            m_gun[0].gameObject.transform.rotation = pistolHolster.rotation;
        }
        else
        {
            m_gun[1].gameObject.transform.position = rifleHolster.position;
            m_gun[1].gameObject.transform.rotation = rifleHolster.rotation;
        }

        bool foundLeader = false;

        //get the squad leader
        foreach (SquadMember squad in m_squad)
        {
            if (squad != null)
            {
                if (squad.isLeader)
                {
                    m_waypoint  = squad.transform;
                    foundLeader = true;
                    isLeader    = false;
                    break;
                }
            }
        }

        if (!foundLeader)
        {
            isLeader = true;
        }

        //and set up the default waypoint
        if (m_waypoint != null)
        {
            m_agent.destination = m_waypoint.position;
        }
        else
        {
            m_waypoint = transform;
        }

        checkCooldown = 500.0f;
        prevPos       = transform.position;
    }