Check if first object in array is a GameObject or a number?

Hello!
I’m making an basic RTS system. I am using an array for each unit movement queue. I am keeping Vector3 positions in the array. I am wondering if it’s possible to have both Vector3 and float numbers in an array, so unit would switch the mode to that number after it’s done it’s other commands in queue? If yes, how is it possible to check whether the first object in array that it is getting is an GameObject or a number/float?
Tried googling this, but I didn’t manage to find anything! Any help is appreciated, thanks.

If you want to have a queue with different commands in it (g. move to, build, then move to, do something other), i would recommend a more OOP attempt. Define an Interface ICommand and make the Queue List.

public interface ICommand
    {
        void Execute();
    }

Then you define your possible command classes, that implement ICommand:

    public class MoveToTarget : ICommand
    {
        private Vector3 m_TargetPoint;

        public MoveToTarget(Vector3 targetPoint)
        {
            m_TargetPoint = targetPoint;
        }
        public void Execute()
        {
            // move to point
        }
    }

    public class BuildStructure : ICommand
    {
        private GameObject m_StructureToBuild;

        public BuildStructure(GameObject structure)
        {
            m_StructureToBuild = structure;
        }

        public void Execute()
        {
            // build structure
        }
    }

And at least you build a queue with those classes. e.g.:

        public void BuildQueue()
        {
            List<ICommand> unitQueue = new List<ICommand>();

            unitQueue.Add(new MoveToTarget(new Vector3(1,2,3)));
            unitQueue.Add(new BuildStructure(factory)));
        }

With this construct you can easily insert new commands, cancel others, whatever.

You can also check the type from you array at runtime:

ArrayList myArray = new ArrayList();
myArray.Add(new Vector3(2, 2, 2));
myArray.Add(new Vector3(3, 3, 3));
myArray.Add(4.0f);
myArray.Add(1.2f);
myArray.Add(new Vector3(4, 4, 4));
for (int i = 0; i < myArray.Count; i++) {
	if (myArray *is Vector3) {*

_ Debug.Log ("Vector3: " + myArray*);_
_
} else {_
_ Debug.Log ("Float: " + myArray);
}
}*
Instead of Vector3, you can check for any type of object._