Exemple #1
0
 // Use this for initialization
 void Start()
 {
     vel          = new Vector3();
     locationMeta = GameObject.FindObjectOfType <LocationMeta>();
     myCamera     = GetComponent <Camera>();
     horVel       = 0;
     verVel       = 0;
 }
Exemple #2
0
        public async Task <IActionResult> Insert(LocationMeta locationMeta)
        {
            var result = await _locationService.Insert(locationMeta);

            if (result.Code > 0)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }
Exemple #3
0
    public static void SaveGlobalsRef()
    {
        LocationMeta lm = GameObject.FindObjectOfType <LocationMeta>();

        if (lm != null)
        {
            lm.globals = (GlobalVariableList)AssetDatabase.LoadAssetAtPath("Assets/Data/GlobalVariables.asset", typeof(GlobalVariableList));
            UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene());
            UnityEditor.SceneManagement.EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo();
        }
    }
Exemple #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <author>ALVES Quentin</author>
        public ReplEditor( )
            : base( )
        {
            Console.Title = "Aurora Repl Editor.";

            this.SetStyle <ReplEditorStyle>( );

            this.is_running = true;
            this.controls   = new List <ReplControlMeta>( );
            this.commands   = new List <ReplCommandMeta>( );
            this.documents  = new ReplDocumentManager( );
            this.lexer      = new Lexer( );
            this.cursor     = new LocationMeta(0, 0);

            this.Initialize( );
        }
Exemple #5
0
    private void LateUpdate()
    {
        if (target == null)
        {
            GameObject playerObject = GameObject.FindGameObjectWithTag("Player");
            if (playerObject != null)
            {
                target             = playerObject.transform;
                transform.position = target.position + Vector3.forward * -10;
            }
        }

        if (locationMeta == null)
        {
            locationMeta = GameObject.FindObjectOfType <LocationMeta>();
        }

        Vector3 targetPos       = target.position;
        Vector3 currentPosition = transform.position;

        if (targetPos.x > currentPosition.x + 2.5)
        {
            currentPosition.x = Mathf.MoveTowards(currentPosition.x, targetPos.x + 2.5f, horSpeed * Time.deltaTime);
        }
        else if (targetPos.x < currentPosition.x - 2.5)
        {
            currentPosition.x = Mathf.MoveTowards(currentPosition.x, targetPos.x - 2.5f, horSpeed * Time.deltaTime);
        }

        currentPosition.y = Mathf.SmoothDamp(currentPosition.y, targetPos.y, ref verVel, verVel, verVel, Time.deltaTime);

        if (currentPosition.x - cameraBounds.x * 0.5f < locationMeta.worldRect.x)
        {
            currentPosition.x = locationMeta.worldRect.x + cameraBounds.x * 0.5f;
        }
        if (currentPosition.x + cameraBounds.x * 0.5f > locationMeta.worldRect.x + locationMeta.worldRect.width)
        {
            currentPosition.x = locationMeta.worldRect.x + locationMeta.worldRect.width - cameraBounds.x * 0.5f;
        }

        if (currentPosition.y < 8)
        {
            currentPosition.y = 8;
        }

        transform.position = Vector3.SmoothDamp(transform.position, currentPosition, ref vel, smoothDamp);
    }
Exemple #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <author>ALVES Quentin</author>
 /// <param name="line" >Line of the source text that contain data</param>
 /// <param name="position" >Offset from line start</param>
 /// <param name="value" >Text store on the metadata</param>
 public Textmeta(int line, int position, string value)
 {
     this.location = new LocationMeta(line, position);
     this.Value    = value;
 }
Exemple #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <author>ALVES Quentin</author>
 public ReplDocument( )
 {
     this.cursor = new LocationMeta(0, 0);
 }