1 registered members (monarch),
1,259
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Unity 3 announced
[Re: Tman]
#314782
03/10/10 22:44
03/10/10 22:44
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Unity is great I had an issue with it's state management system, which is seemingly going to get worked out. I might just switch back to complete my project. Anyone wanna give a script example of a function from Unity that feels comfortable for a C-Script/Lite-C user? For instance, how would I write things like camera looks at me, enemy follows me, state switches from attack to flee...
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#314787
03/10/10 22:54
03/10/10 22:54
|
Joined: Apr 2002
Posts: 4,801 Richmond B.C., Canada
Captain_Kiyaku
Dichotomic
|
Dichotomic
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
|
Unity is great I had an issue with it's state management system, which is seemingly going to get worked out. I might just switch back to complete my project. Anyone wanna give a script example of a function from Unity that feels comfortable for a C-Script/Lite-C user? For instance, how would I write things like camera looks at me, enemy follows me, state switches from attack to flee... Camera looks at me (all in C#):
public Transform playerPtr;
void Update()
{
transform.LookAt(playerPtr);
}
assign it to the camera in the editor, and drag n drop the player into the "playerPtr" field. done. Enemy follows player is simliar:
public Transform playerPtr;
void Update()
{
transform.LookAt(playerPtr);
transfor.Translate(Vector3.forward * 20); // Move enemy into his forward Vector
}
Apply to enemy, drag n drop player into the playerPtr field, done. For statement switches, i actually always use ENUMS
private enum MoveStates
{
ATTACK,
FLEE,
IDLE
}
private MoveStates moveState;
...
// If player comes too close, flee
if(Vector3.Distance(transform.position, playerPtr.position) < 1))
moveState = MoveStates.FLEE;
...
void Update()
{
switch(moveState)
{
case MoveStates.FLEE:
transform.LookAt(playerPtr);
transform.Translate(-Vector3.forward * 10);
break;
}
}
It would run away backwards, looking at the player, but just to get an idea how you would make it. Is it that what you wanted to know? EDIT: i left out the class definitions and library includings, as this is genereated automatically when creating a script anyway and looks the same for almost any script anyway. it is just a plain:
using UnityEngine;
using System.Collections;
public class scriptName : MonoBehaviour
{
void Start()
{
}
void Update()
{
}
}
Last edited by Captain_Kiyaku; 03/10/10 22:58.
My Blog"Tag und Nacht schrei ich mich heiser, Wind weht alle Worte fort, Tag und Nacht schrei ich mein Krähenwort!"Subway To Sally - Krähenkönig
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#314790
03/10/10 23:19
03/10/10 23:19
|
Joined: Apr 2002
Posts: 4,801 Richmond B.C., Canada
Captain_Kiyaku
Dichotomic
|
Dichotomic
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
|
Well the class thing isn't too relevant actually and you still could write in Javascript.
The class gets created for you by default when you create a script. You just have to make sure the class name is the equal to the files name.
And then you add all function into that class. There are default function like Start, Update, OnGUI, etc or you create your own ones (void foo(), int counter() ,etc).
You usually dont have multiple classes in one script file, so it doesn't really matter. Just see it as a border around your functions.
My Blog"Tag und Nacht schrei ich mich heiser, Wind weht alle Worte fort, Tag und Nacht schrei ich mein Krähenwort!"Subway To Sally - Krähenkönig
|
|
|
Re: Unity 3 announced
[Re: Captain_Kiyaku]
#314791
03/10/10 23:25
03/10/10 23:25
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
@Kihaku, you have any suggestions where to start with unity?(like you start with lite-c workshops for gamestudio)
Know the concepts and patterns of object oriented programming and have some just a alittle above beginner c# experience, i also know javascript.
3333333333
|
|
|
Re: Unity 3 announced
[Re: Quad]
#314795
03/10/10 23:37
03/10/10 23:37
|
Joined: Aug 2008
Posts: 6
Konrad
Newbie
|
Newbie
Joined: Aug 2008
Posts: 6
|
|
|
|
Re: Unity 3 announced
[Re: Machinery_Frank]
#314816
03/11/10 10:12
03/11/10 10:12
|
Joined: Dec 2003
Posts: 1,225 germany
gri
Serious User
|
Serious User
Joined: Dec 2003
Posts: 1,225
germany
|
hi,
I checked the feature list of the HOLY free unity3d indie version.
Looks nice, but for me Render_To_Texture is a must-have! So it have to pay 880,- euro for this feature.
And there are no Realtime-shadows, no Fullscreen Postprocessing. So I come to the following conclusion:
Unity PRO is very nice no question and for the guys who have the money its a big improvement compared with Gamestudio.
Unity Indie doesnt realy compete with A7 com because the lack of features I want to have and get with A7 com !
So I wish all unity Indie fans much fun playing around with the included nice looking WorldEditor and coding in "modern" language like C#.
But what can you realy reach with this castrated version?
Building the 10000000-st Iphone App , maybe a puzzle-game in 3D? -useless
So I stay with A7 comm. Maybe its Editors looks outdated but I dont what to marry them( I have affairs with Blender already). I only need the potency of the Engine.
This is like the cars of 2 individuals.
The one likes the nice looking shiny varnish of his car and triggers the buttons of the stereo. He gives a damn that his engine was limited to drive only on Highways ....he loves to observing the automatic-antenna .
The other one doesnt care about the hard working steering control his car have. The car got cleaned 10 years ago but hey(!) he can drive wherever he want.
And yes I agree unity Pro is like a Porsche possible to swim,dive and fly.
regards gri,
"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
|
|
|
|